File size: 1,944 Bytes
4e159ba 068b166 4e159ba 068b166 |
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 |
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
# Function for male superhero task
def run_male_superhero_task():
st.write("Training Male Superhero model...")
# Male superhero training logic goes here
# Add dummy print statements as a placeholder
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.")
# Function for female superhero task
def run_female_superhero_task():
st.write("Training Female Superhero model...")
# Female superhero training logic goes here
# Add dummy print statements as a placeholder
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.")
# Streamlit UI
st.title("AI Training Demo")
# Task selection buttons
task = st.selectbox("Choose a task:", ("Superhero", "Disease"))
if task == "Superhero":
# Sub-options for Male and Female 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)
|