paragon-analytics commited on
Commit
47f6882
·
verified ·
1 Parent(s): 4a55cb5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 {"Leave": float(prob[0][0]), "Stay": 1-float(prob[0][0])}, local_plot
46
 
47
  # Create the UI
48
- title = "**Employee Turnover Predictor & Interpreter** 🪐"
49
  description1 = """
50
- This app takes five inputs about employees' satisfaction with different aspects of their work and two demographic inputs then predicts whether the employee intends to stay with the employer or leave. There are two outputs from the app: 1- the predicted probability of stay or leave, 2- Shapley's force-plot which visualizes the extent to which each factor impacts the stay/ leave prediction.
51
  """
52
 
53
  description2 = """
54
- To use the app, click on one of the examples, or adjust the values of the seven employee satisfaction factors, and click on Analyze. ✨
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="Employee_Turnover"
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:")