Spaces:
Runtime error
Runtime error
Updated gradio inputs to gr directly
Browse files
app.py
CHANGED
@@ -83,51 +83,51 @@ def predict(age, female, race, elective, aweekend, zipinc_qrtl, hosp_region, hos
|
|
83 |
'Predicting Death Outcome:': pred['Label'][0]}
|
84 |
|
85 |
# Defining the containers for each input
|
86 |
-
age = gr.
|
87 |
-
female = gr.
|
88 |
-
race = gr.
|
89 |
-
elective = gr.
|
90 |
-
aweekend = gr.
|
91 |
-
zipinc_qrtl = gr.
|
92 |
-
hosp_region = gr.
|
93 |
-
hosp_division = gr.
|
94 |
-
hosp_locteach = gr.
|
95 |
-
hosp_bedsize = gr.
|
96 |
-
h_contrl = gr.
|
97 |
-
pay = gr.
|
98 |
-
anemia = gr.
|
99 |
-
atrial_fibrillation = gr.
|
100 |
-
cancer = gr.
|
101 |
-
cardiac_arrhythmias = gr.
|
102 |
-
carotid_artery_disease = gr.
|
103 |
-
chronic_kidney_disease = gr.
|
104 |
-
chronic_pulmonary_disease = gr.
|
105 |
-
coagulopathy = gr.
|
106 |
-
depression = gr.
|
107 |
-
diabetes_mellitus = gr.
|
108 |
-
drug_abuse = gr.
|
109 |
-
dyslipidemia = gr.
|
110 |
-
endocarditis = gr.
|
111 |
-
family_history = gr.
|
112 |
-
fluid_and_electrolyte_disorder = gr.
|
113 |
-
heart_failure = gr.
|
114 |
-
hypertension = gr.
|
115 |
-
known_cad = gr.
|
116 |
-
liver_disease = gr.
|
117 |
-
obesity = gr.
|
118 |
-
peripheral_vascular_disease = gr.
|
119 |
-
prior_cabg = gr.
|
120 |
-
prior_icd = gr.
|
121 |
-
prior_mi = gr.
|
122 |
-
prior_pci = gr.
|
123 |
-
prior_ppm = gr.
|
124 |
-
prior_tia_stroke = gr.
|
125 |
-
pulmonary_circulation_disorder = gr.
|
126 |
-
smoker = gr.
|
127 |
-
valvular_disease = gr.
|
128 |
-
weight_loss = gr.
|
129 |
-
endovascular_tavr = gr.
|
130 |
-
transapical_tavr = gr.
|
131 |
|
132 |
|
133 |
# Defining and launching the interface
|
|
|
83 |
'Predicting Death Outcome:': pred['Label'][0]}
|
84 |
|
85 |
# Defining the containers for each input
|
86 |
+
age = gr.Slider(minimum=18, maximum=100, default=60, label="Age")
|
87 |
+
female = gr.Dropdown(choices=["Female", "Male"],label = 'Sex')
|
88 |
+
race = gr.Dropdown(choices=['Asian or Pacific Islander', 'Black', 'Hispanic', 'Native American', 'White', 'Other'], label = 'Race')
|
89 |
+
elective = gr.Radio(choices=['Elective', 'NonElective'], label = 'Elective')
|
90 |
+
aweekend = gr.Radio(choices=["No", "Yes"], label = 'Weekend')
|
91 |
+
zipinc_qrtl = gr.Radio(choices=['FirstQ', 'SecondQ', 'ThirdQ', 'FourthQ'], label = 'Zip Income Quartile')
|
92 |
+
hosp_region = gr.Radio(choices=['Midwest', 'Northeast', 'South', 'West'], label = 'Hospital Region')
|
93 |
+
hosp_division = gr.Radio(choices=['New England', 'Middle Atlantic', 'East North Central', 'West North Central', 'South Atlantic', 'East South Central', 'West South Central', 'Mountain', 'Pacific'], label = 'Hospital Division')
|
94 |
+
hosp_locteach = gr.Radio(choices=['Urban teaching', 'Urban nonteaching', 'Rural'], label= 'Hospital Location/Teaching')
|
95 |
+
hosp_bedsize = gr.Radio(choices=['Small', 'Medium', 'Large'], label= 'Hospital Bedsize')
|
96 |
+
h_contrl = gr.Radio(choices= ['Government_nonfederal', 'Private_invest_own', 'Private_not_profit'], label = 'Hospital Control')
|
97 |
+
pay = gr.Dropdown(choices= ['Private insurance', 'Medicare', 'Medicaid', 'Self-pay', 'No charge', 'Other'], label = 'Payee')
|
98 |
+
anemia = gr.Radio(choices=["No", "Yes"], label = 'Anemia')
|
99 |
+
atrial_fibrillation = gr.Radio(choices=["No", "Yes"], label = 'Atrial Fibrillation')
|
100 |
+
cancer = gr.Radio(choices=["No", "Yes"], label = 'Cancer')
|
101 |
+
cardiac_arrhythmias = gr.Radio(choices=["No", "Yes"], label = 'Cardiac Arrhythmias')
|
102 |
+
carotid_artery_disease = gr.Radio(choices=["No", "Yes"], label = 'Carotid Artery Disease')
|
103 |
+
chronic_kidney_disease = gr.Radio(choices=["No", "Yes"], label = 'Chronic Kidney Disease')
|
104 |
+
chronic_pulmonary_disease = gr.Radio(choices=["No", "Yes"], label = 'Chronic Pulmonary Disease')
|
105 |
+
coagulopathy = gr.Radio(choices=["No", "Yes"], label = 'Coagulopathy')
|
106 |
+
depression = gr.Radio(choices=["No", "Yes"], label = 'Depression')
|
107 |
+
diabetes_mellitus = gr.Radio(choices=["No", "Yes"], label = 'Diabetes Mellitus')
|
108 |
+
drug_abuse = gr.Radio(choices=["No", "Yes"], label = 'Drug Abuse')
|
109 |
+
dyslipidemia = gr.Radio(choices=["No", "Yes"], label = 'Dyslipidemia')
|
110 |
+
endocarditis = gr.Radio(choices=["No", "Yes"], label = 'Endocarditis')
|
111 |
+
family_history = gr.Radio(choices=["No", "Yes"], label = 'Family History')
|
112 |
+
fluid_and_electrolyte_disorder = gr.Radio(choices=["No", "Yes"], label = 'Fluid and Electrolyte Disorder')
|
113 |
+
heart_failure = gr.Radio(choices=["No", "Yes"], label = 'Heart Failure')
|
114 |
+
hypertension = gr.Radio(choices=["No", "Yes"], label = 'Hypertension')
|
115 |
+
known_cad = gr.Radio(choices=["No", "Yes"], label = 'Known CAD')
|
116 |
+
liver_disease = gr.Radio(choices=["No", "Yes"], label = 'Liver Disease')
|
117 |
+
obesity = gr.Radio(choices=["No", "Yes"], label = 'Obesity')
|
118 |
+
peripheral_vascular_disease = gr.Radio(choices=["No", "Yes"], label = 'Peripheral Vascular Disease')
|
119 |
+
prior_cabg = gr.Radio(choices=["No", "Yes"], label = 'Prior CABG')
|
120 |
+
prior_icd = gr.Radio(choices=["No", "Yes"], label = 'Prior ICD')
|
121 |
+
prior_mi = gr.Radio(choices=["No", "Yes"], label = 'Prior MI')
|
122 |
+
prior_pci = gr.Radio(choices=["No", "Yes"], label = 'Prior PCI')
|
123 |
+
prior_ppm = gr.Radio(choices=["No", "Yes"], label = 'Prior PPM')
|
124 |
+
prior_tia_stroke = gr.Radio(choices=["No", "Yes"], label = 'Prior TIA Stroke')
|
125 |
+
pulmonary_circulation_disorder = gr.Radio(choices=["No", "Yes"], label = 'Pulmonary Circulation Disorder')
|
126 |
+
smoker = gr.Radio(choices=["No", "Yes"], label = 'Smoker')
|
127 |
+
valvular_disease = gr.Radio(choices=["No", "Yes"], label = 'Valvular Disease')
|
128 |
+
weight_loss = gr.Radio(choices=["No", "Yes"], label = 'Weight Loss')
|
129 |
+
endovascular_tavr = gr.Radio(choices=["No", "Yes"], label = 'Endovascular TAVR')
|
130 |
+
transapical_tavr = gr.Radio(choices=["No", "Yes"], label = 'Transapical TAVR', default= 'Yes')
|
131 |
|
132 |
|
133 |
# Defining and launching the interface
|