zohaibterminator commited on
Commit
db50ec9
·
verified ·
1 Parent(s): 8144f7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -96,17 +96,14 @@ if st.button("Predict"):
96
  Oldpeak=oldpeak,
97
  ST_Slope=st_slope
98
  )
99
-
100
- # Send a request to the FastAPI server
101
- response = predict(data)
102
-
103
- # Display the result
104
- if response.status_code == 200:
105
- prediction = response.json()["prediction"]
106
- result = "Positive for heart disease" if prediction == 1 else "Negative for heart disease"
107
- st.success(f"Prediction: {result}")
108
  else:
109
- st.error("Error: Unable to get prediction from API. Please try again later.")
110
 
111
 
112
  st.subheader("Batch Prediction")
 
96
  Oldpeak=oldpeak,
97
  ST_Slope=st_slope
98
  )
99
+
100
+ result = predict(data)
101
+
102
+ st.write("### Prediction:")
103
+ if result == 1:
104
+ st.write("The model predicts a high risk of heart disease.")
 
 
 
105
  else:
106
+ st.write("The model predicts a low risk of heart disease.")
107
 
108
 
109
  st.subheader("Batch Prediction")