File size: 938 Bytes
cef55bb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
from pycaret.datasets import get_data
from pycaret.classification import *
import streamlit as st
from pathlib import Path
path_root = Path(Path.cwd())
st.sidebar.markdown("# Main page 🎈")
st.title("Classification")
@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)
|