File size: 1,120 Bytes
ab45178
cef55bb
 
 
 
ab45178
cef55bb
 
 
ab45178
 
 
 
 
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
40
41
42
43
44
45
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)