Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,18 +29,19 @@ def main():
|
|
| 29 |
# clicked==True only when the button is clicked
|
| 30 |
clicked = st.form_submit_button("Predict Stroke")
|
| 31 |
if clicked:
|
| 32 |
-
result=model.predict(pd.DataFrame({"
|
| 33 |
-
"
|
| 34 |
-
"
|
| 35 |
-
"
|
| 36 |
-
"
|
| 37 |
-
"
|
| 38 |
-
"
|
| 39 |
-
"
|
| 40 |
-
"
|
| 41 |
# Show prediction
|
| 42 |
result = 'Yes' if result[0] == 1 else 'No'
|
| 43 |
st.success("Your predicted Stroke is "+result)
|
|
|
|
| 44 |
# Run main()
|
| 45 |
if __name__ == "__main__":
|
| 46 |
main()
|
|
|
|
| 29 |
# clicked==True only when the button is clicked
|
| 30 |
clicked = st.form_submit_button("Predict Stroke")
|
| 31 |
if clicked:
|
| 32 |
+
result=model.predict(pd.DataFrame({"gender": [gender],
|
| 33 |
+
"age": [age],
|
| 34 |
+
"hypertension": [hypertension],
|
| 35 |
+
"heart_disease": [heart_disease],
|
| 36 |
+
"work_type": [work_type],
|
| 37 |
+
"Resident_type": [residence],
|
| 38 |
+
"avg_glucose_level": [glucose_level],
|
| 39 |
+
"bmi": [bmi],
|
| 40 |
+
"smoking_status": [smoking]}))
|
| 41 |
# Show prediction
|
| 42 |
result = 'Yes' if result[0] == 1 else 'No'
|
| 43 |
st.success("Your predicted Stroke is "+result)
|
| 44 |
+
|
| 45 |
# Run main()
|
| 46 |
if __name__ == "__main__":
|
| 47 |
main()
|