File size: 1,839 Bytes
0d346b7
 
 
 
0055516
0d346b7
 
b2f3388
0d346b7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0055516
0d346b7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0055516
0d346b7
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
46
47
48
49
50
51
52
53
54
55
56
57
import os

import pandas as pd
import pandas_profiling
import streamlit as st
#ML stuff
from pycaret.classification import compare_models, pull, save_model, setup
#from pycaret.regression import compare_models, pull, save_model, setup
from streamlit_pandas_profiling import st_profile_report

with st.sidebar:
    st.image("https://cdn.pixabay.com/photo/2018/09/18/11/19/artificial-intelligence-3685928_1280.png")
    st.title("EasyAutoML")
    choice = st.radio("Navigation",["Data loading","Exploratory","Modeling","Download"])
    st.info("This application to explore your data & build an automated ML pipeline.")


if os.path.exists("source_data.csv"):
    df = pd.read_csv("source_data.csv", index_col=None)


if choice == "Data loading":
    st.title("Upload your data for modeling") 
    file = st.file_uploader("Upload your dataset here")
    if file:
        df = pd.read_csv(file, index_col=None)
        df.to_csv("source_data.csv", index=None)
        st.dataframe(df)

elif choice == "Exploratory":
    st.title('Automated EDA')
    profile_report = df.profile_report()
    st_profile_report(profile_report)
    
elif choice == "Modeling":
    
    st.title('Time for ML')
    target = st.selectbox('Choose the target column', df.columns)
    if st.button("Train model"):
        setup(df, target=target, silent=True)
        setup_df = pull()
        st.info("This is the ML experiment settings")
        st.dataframe(setup_df)
        best_model = compare_models()
        compare_df = pull()
        st.info("This is the ML model")
        st.dataframe(compare_df)
        best_model
        save_model(best_model, 'best_model')
elif choice == "Download":
    with open("best_model.pkl",'rb') as f:
        st.download_button("Download the model file",f,"best_model.pkl")
else:
    pass

st.write("Made with <3 by Amdjed")