|
import streamlit as st |
|
import numpy as np |
|
import torch |
|
import torch.nn as nn |
|
import torch.optim as optim |
|
from sklearn.utils import shuffle |
|
from sklearn.preprocessing import StandardScaler |
|
from sklearn.linear_model import LogisticRegression |
|
from sklearn.model_selection import train_test_split |
|
|
|
from NdR_disease import run_disease_train, get_user_input_and_predict |
|
|
|
|
|
|
|
def run_male_superhero_task(): |
|
st.write("Training Male Superhero model...") |
|
|
|
|
|
st.write("Male superhero model - Step 1: Data prepared.") |
|
st.write("Male superhero model - Step 2: Model trained.") |
|
st.write("Male superhero model - Step 3: Results evaluated.") |
|
|
|
|
|
|
|
def run_female_superhero_task(): |
|
st.write("Training Female Superhero model...") |
|
|
|
|
|
st.write("Female superhero model - Step 1: Data prepared.") |
|
st.write("Female superhero model - Step 2: Model trained.") |
|
st.write("Female superhero model - Step 3: Results evaluated.") |
|
|
|
|
|
|
|
st.title("AI Training Demo") |
|
|
|
|
|
task = st.selectbox("Choose a task:", ("Superhero", "Disease")) |
|
|
|
if task == "Superhero": |
|
|
|
gender = st.selectbox("Choose the gender:", ("Male", "Female")) |
|
|
|
if gender == "Male": |
|
if st.button("Run Male Superhero Task"): |
|
run_male_superhero_task() |
|
|
|
elif gender == "Female": |
|
if st.button("Run Female Superhero Task"): |
|
run_female_superhero_task() |
|
|
|
elif task == "Disease": |
|
if st.button("Run Disease Task"): |
|
linear_model, neural_model, scaler, conditions, num_classes = run_disease_train() |
|
get_user_input_and_predict(linear_model, neural_model, scaler, conditions, num_classes) |
|
|