DaniloTertu commited on
Commit
e5a321d
·
1 Parent(s): 217e2d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
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
- return str(prediction)
 
 
 
 
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")