|
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) |
|
|
|
|
|
|