Spaces:
Runtime error
Runtime error
Commit
·
e5a321d
1
Parent(s):
217e2d7
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,7 +29,11 @@ def predict(gender, ever_married, work_type, residence_type, smoking_status, age
|
|
| 29 |
input_data[cats] = input_data[cats].apply(lambda x: x.cat.codes)
|
| 30 |
|
| 31 |
prediction = m.predict(input_data)
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
|
| 35 |
gender = gr.inputs.Radio(choices=["Male", "Female", "Other"], label="Gender")
|
|
|
|
| 29 |
input_data[cats] = input_data[cats].apply(lambda x: x.cat.codes)
|
| 30 |
|
| 31 |
prediction = m.predict(input_data)
|
| 32 |
+
|
| 33 |
+
if prediction == [0]:
|
| 34 |
+
return "didn't have a stroke"
|
| 35 |
+
return "have a stroke"
|
| 36 |
+
|
| 37 |
|
| 38 |
|
| 39 |
gender = gr.inputs.Radio(choices=["Male", "Female", "Other"], label="Gender")
|