Spaces:
Sleeping
Sleeping
criticalDanger
commited on
Commit
•
a265aea
1
Parent(s):
ba0f32f
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ with open('heart_disease_model.pkl', 'rb') as file:
|
|
8 |
|
9 |
# Define the prediction function
|
10 |
def predict_heart_disease(male, age, currentSmoker, cigsPerDay, BPMeds, prevalentStroke, prevalentHyp, diabetes, BMI):
|
11 |
-
male = 1 if male ==
|
12 |
currentSmoker = 1 if currentSmoker == "Yes" else 0
|
13 |
BPMeds = 1 if BPMeds == "Yes" else 0
|
14 |
prevalentStroke = 1 if prevalentStroke == "Yes" else 0
|
@@ -20,7 +20,7 @@ def predict_heart_disease(male, age, currentSmoker, cigsPerDay, BPMeds, prevalen
|
|
20 |
|
21 |
# Define the input components
|
22 |
inputs = [
|
23 |
-
gr.
|
24 |
gr.Number(label="Age"),
|
25 |
gr.Text(label="Do you smoke? (Yes/No)"),
|
26 |
gr.Number(label="Number of ciggerates a day"),
|
|
|
8 |
|
9 |
# Define the prediction function
|
10 |
def predict_heart_disease(male, age, currentSmoker, cigsPerDay, BPMeds, prevalentStroke, prevalentHyp, diabetes, BMI):
|
11 |
+
male = 1 if male == "Male" else 0
|
12 |
currentSmoker = 1 if currentSmoker == "Yes" else 0
|
13 |
BPMeds = 1 if BPMeds == "Yes" else 0
|
14 |
prevalentStroke = 1 if prevalentStroke == "Yes" else 0
|
|
|
20 |
|
21 |
# Define the input components
|
22 |
inputs = [
|
23 |
+
gr.Textbox(label="Sex (Male/Female)"),
|
24 |
gr.Number(label="Age"),
|
25 |
gr.Text(label="Do you smoke? (Yes/No)"),
|
26 |
gr.Number(label="Number of ciggerates a day"),
|