|
import gradio as gr |
|
|
|
model = gr.inputs.Dropdown(list(compare_model_results['Model']),label="Model") |
|
gender = gr.inputs.Dropdown(choices=["Male", "Female"],label = 'gender') |
|
age = gr.inputs.Slider(minimum=1, maximum=100, default=data['age'].mean(), label = 'age') |
|
hypertension = gr.inputs.Dropdown(choices=["1", "0"],label = 'hypertension') |
|
heart_disease = gr.inputs.Dropdown(choices=["1", "0"],label ='heart_disease') |
|
ever_married = gr.inputs.Dropdown(choices=["Yes", "No"], label ='ever_married') |
|
work_type = gr.inputs.Dropdown(choices=["children", "Govt_job","Never_worked","Private","Self-employed"],label = 'work_type') |
|
Residence_type = gr.inputs.Dropdown(choices=["Urban", "Rural"],label = 'Residence_type') |
|
avg_glucose_level = gr.inputs.Slider(minimum=-55, maximum=300, default=data['avg_glucose_level'].mean(), label = 'avg_glucose_level') |
|
bmi = gr.inputs.Slider(minimum=-10, maximum=100, default=data['bmi'].mean(), label = 'bmi') |
|
smoking_status = gr.inputs.Dropdown(choices=["Unknown", "smokes","never_smoked", "formerly_smoked"], label ='smoking_status') |
|
|
|
gr.Interface(predict,[model, gender, age, hypertension, heart_disease, ever_married, work_type, Residence_type, avg_glucose_level, bmi, smoking_status], "label",live=True).launch() |
|
|
|
|