AutoML / app.py
Théo Villette
put aside mse and f1
8bca716
raw
history blame
1.77 kB
import streamlit as st
import pandas as pd
from autoML import autoML
st.set_page_config(layout="wide")
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', type='csv')
task = st.selectbox(label='Task', options=['Classification', 'Regression'])
if task == 'Classification':
metric_to_minimize_class = st.selectbox(label='Metric to minimize', options=['accuracy'])
metric_to_minimize_reg = None
if task == 'Regression':
metric_to_minimize_reg = st.selectbox(label='Metric to minimize', options=['r2'])
metric_to_minimize_class = None
if csv:
df = pd.read_csv(csv)
df.to_csv('datasets/temp_file.csv', index=False)
lst_features = df.columns
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('datasets/temp_file.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')