File size: 1,939 Bytes
2aa4a2c
a797e45
 
2aa4a2c
 
cb240cd
2aa4a2c
8f578ae
2aa4a2c
 
cb240cd
b2327d1
7f6d191
cb240cd
8f578ae
cb240cd
 
 
cc69360
cb240cd
cc69360
cb240cd
 
 
7f6d191
cb240cd
 
 
 
 
 
b2327d1
cb240cd
b2327d1
cb240cd
 
 
cc69360
cb240cd
 
cc69360
 
cb240cd
8f578ae
cb240cd
8f578ae
cc69360
cb240cd
cc69360
52525de
cb240cd
 
 
 
 
cc69360
8f578ae
cb240cd
8f578ae
52525de
cb240cd
 
 
 
 
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
58
59
60
61
62
63
64
65
66
import streamlit as st
from flaml.automl.data import get_output_from_log
import plotly.express as px

from utils import csv_to_featuers_list, pre_process_df, pre_process_features
from autoML import autoML


st.set_page_config(layout="wide")

# add categorical features
# handle missing values with automl (not possible)

with st.sidebar:

    st.subheader('Demo Datasets')
    demo_but_class = st.button(label="Demo Classification on Wine Rate Dataset")
    demo_but_reg = st.button(label="Demo Regression on California House Dataset")

    st.subheader('AutoML your Dataset')

    csv = st.file_uploader(label='CSV file')
    if csv != None:
        csv = csv.name
    
    task = st.selectbox(label='Task', options=['Classification', 'Regression'])

    if task == 'Classification':
        metric_to_minimize_class = st.selectbox(label='Metric to minimize', options=['accuracy', 'f1'])
        metric_to_minimize_reg = None
    if task == 'Regression':
        metric_to_minimize_reg = st.selectbox(label='Metric to minimize', options=['r2', 'mse', 'rmse'])
        metric_to_minimize_class = None
        
    if csv:
        lst_features = csv_to_featuers_list(csv)
        label = st.selectbox(label='Label', options=lst_features)
    
    budget = st.text_area(label='Budget Time', value="5")
    start_but = st.button(label='AutoML')


if start_but:

    autoML(csv, task, budget, label, metric_to_minimize_class, metric_to_minimize_reg)


if demo_but_class:

    autoML(csv='datasets/WineRate.csv', 
           task='Classification', 
           budget=budget, 
           label='quality', 
           metric_to_minimize_class='accuracy', 
           metric_to_minimize_reg=None)


if demo_but_reg:

    autoML(csv='datasets/house_california.csv', 
           task='Regression', 
           budget=budget, 
           label='median_house_value', 
           metric_to_minimize_class=None, 
           metric_to_minimize_reg='r2')