Update app.py
Browse files
app.py
CHANGED
|
@@ -42,16 +42,16 @@ def main_func(age, sex, cp, trestbps, chol, fbs, restecg, thalach,
|
|
| 42 |
plt.rcParams['figure.figsize'] = 7,4
|
| 43 |
plt.close()
|
| 44 |
|
| 45 |
-
return {"
|
| 46 |
|
| 47 |
# Create the UI
|
| 48 |
-
title = "**
|
| 49 |
description1 = """
|
| 50 |
-
This app takes
|
| 51 |
"""
|
| 52 |
|
| 53 |
description2 = """
|
| 54 |
-
To use the app, click on one of the examples, or adjust the values of the
|
| 55 |
"""
|
| 56 |
|
| 57 |
with gr.Blocks(title=title) as demo:
|
|
@@ -85,7 +85,7 @@ with gr.Blocks(title=title) as demo:
|
|
| 85 |
submit_btn.click(
|
| 86 |
main_func,
|
| 87 |
[age, sex,cp,trestbps,chol,fbs,restecg,thalach,exang,oldpeak,slope,ca,thal],
|
| 88 |
-
[label,local_plot], api_name="
|
| 89 |
)
|
| 90 |
|
| 91 |
gr.Markdown("### Click on any of the examples below to see how it works:")
|
|
|
|
| 42 |
plt.rcParams['figure.figsize'] = 7,4
|
| 43 |
plt.close()
|
| 44 |
|
| 45 |
+
return {"Normal Heart Condition": float(prob[0][0]), "Critical Heart Condition": 1-float(prob[0][0])}, local_plot
|
| 46 |
|
| 47 |
# Create the UI
|
| 48 |
+
title = "**Heart Condition Predictor & Interpreter** 🪐"
|
| 49 |
description1 = """
|
| 50 |
+
This app takes inputs about patients' demographics and medical history to predict whether the patient has heart condition. There are two outputs from the app: 1- the predicted probability of normal condition or heart condition, 2- Shapley's force-plot which visualizes the extent to which each factor impacts the prediction.
|
| 51 |
"""
|
| 52 |
|
| 53 |
description2 = """
|
| 54 |
+
To use the app, click on one of the examples, or adjust the values of the patient factors, and click on Analyze. ✨
|
| 55 |
"""
|
| 56 |
|
| 57 |
with gr.Blocks(title=title) as demo:
|
|
|
|
| 85 |
submit_btn.click(
|
| 86 |
main_func,
|
| 87 |
[age, sex,cp,trestbps,chol,fbs,restecg,thalach,exang,oldpeak,slope,ca,thal],
|
| 88 |
+
[label,local_plot], api_name="Heart_Condition"
|
| 89 |
)
|
| 90 |
|
| 91 |
gr.Markdown("### Click on any of the examples below to see how it works:")
|