pycaret / app.py
tonne's picture
update demo
ab45178
raw
history blame
No virus
1.12 kB
import pandas as pd
from pycaret.datasets import get_data
from pycaret.classification import *
import streamlit as st
from pathlib import Path
from sysinfo import get_systeminfo
path_root = Path(Path.cwd())
st.sidebar.markdown("# Main page 🎈")
st.title("Classification")
st.markdown("### System Info")
print(get_systeminfo())
df = pd.DataFrame.from_dict(get_systeminfo())
print(df)
st.dataframe(df)
@st.cache
def load_data():
data = get_data('diabetes')
return data
data = load_data()
s = setup(data, target = 'Class variable')
best = compare_models()
df_metric = pull()
st.markdown("Compare model")
st.dataframe(df_metric)
evaluate_model(best)
cols = st.columns(2)
with cols[0]:
try:
st.markdown("## AUC")
plot_model(best, plot = 'auc', save = 'images')
st.image(str(path_root.joinpath("images/AUC.png")))
except e:
st.text(e)
with cols[1]:
st.markdown("## Confusion Matrix")
try:
plot_model(best, plot = 'confusion_matrix', save = 'images')
st.image(str(path_root.joinpath("images/Confusion Matrix.png")))
except e:
st.text(e)