wszhang1021 commited on
Commit
4f640c2
·
1 Parent(s): 1f479d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -13,11 +13,11 @@ loaded_model = pickle.load(open("heart_xgb.pkl", 'rb'))
13
  explainer = shap.Explainer(loaded_model) # PLEASE DO NOT CHANGE THIS.
14
 
15
  gender = {"Female":0,"Male":1}
16
- chest = {"typical angina":1,"atypical angina":2,"non-anginal pain":3,"asymptomatic":4}
17
  choice = {"True":1, "False":0}
18
  rest = {"Probable or Definite Left Ventricular Hypertrophy by Estes' Criteria":2, "Having ST - T Wave Abnormality":1,"Normal Value":0}
19
- ex = {"yes":1, "no":0}
20
- sl = {"upsloping":2, "flat":1,"downsloping":0}
21
  th = {"Reversible Defect":3, "Normal Blood Flow":2, "Fixed Defect":1}
22
 
23
  # Create the main function for server
@@ -74,13 +74,13 @@ with gr.Blocks(title=title) as demo:
74
 
75
  with gr.Row():
76
  with gr.Column():
77
- age = gr.Slider(label="Age", minimum=0, maximum=90, value=40, step=1)
78
- sex = gr.Dropdown(label="Sex", choices =["Female","Male"])
79
  cp = gr.Radio(label="Chest Pain Type", choices = ["typical angina", "atypical angina", "non-anginal pain", "asymptomatic"])
80
  trtbps = gr.Slider(label="Resting Blood Pressure (in mm Hg)", minimum=90, maximum=200, value=90, step=1)
81
  chol = gr.Slider(label="Cholestoral in mg/dl", minimum=120, maximum=570, value=120, step=1)
82
  fbs = gr.Radio(label="Fasting Blood Sugar", choices = ["True", "False"])
83
- restecg = gr.Dropdown(label="Resting Electrocardiographic Results", choices = ["Probable or Definite Left Ventricular Hypertrophy by Estes' Criteria", "Having ST - T Wave Abnormality","Normal Value"])
84
  with gr.Column():
85
  thalachh = gr.Slider(label="Maximum Heart Rate", minimum=70, maximum=210, value=70, step=1)
86
  exng = gr.Slider(label="Exercise Induced Angina", choices = ["yes","no"])
 
13
  explainer = shap.Explainer(loaded_model) # PLEASE DO NOT CHANGE THIS.
14
 
15
  gender = {"Female":0,"Male":1}
16
+ chest = {"Typical angina":1,"Atypical angina":2,"Non-anginal pain":3,"Asymptomatic":4}
17
  choice = {"True":1, "False":0}
18
  rest = {"Probable or Definite Left Ventricular Hypertrophy by Estes' Criteria":2, "Having ST - T Wave Abnormality":1,"Normal Value":0}
19
+ ex = {"Yes":1, "No":0}
20
+ sl = {"Upsloping":2, "Flat":1,"Downsloping":0}
21
  th = {"Reversible Defect":3, "Normal Blood Flow":2, "Fixed Defect":1}
22
 
23
  # Create the main function for server
 
74
 
75
  with gr.Row():
76
  with gr.Column():
77
+ age = gr.Slider(label="Age", minimum=0, maximum=100, value=40, step=1)
78
+ sex = gr.Radio(label="Sex", choices =["Female","Male"])
79
  cp = gr.Radio(label="Chest Pain Type", choices = ["typical angina", "atypical angina", "non-anginal pain", "asymptomatic"])
80
  trtbps = gr.Slider(label="Resting Blood Pressure (in mm Hg)", minimum=90, maximum=200, value=90, step=1)
81
  chol = gr.Slider(label="Cholestoral in mg/dl", minimum=120, maximum=570, value=120, step=1)
82
  fbs = gr.Radio(label="Fasting Blood Sugar", choices = ["True", "False"])
83
+ restecg = gr.Radio(label="Resting Electrocardiographic Results", choices = ["Probable or Definite Left Ventricular Hypertrophy by Estes' Criteria", "Having ST - T Wave Abnormality","Normal Value"])
84
  with gr.Column():
85
  thalachh = gr.Slider(label="Maximum Heart Rate", minimum=70, maximum=210, value=70, step=1)
86
  exng = gr.Slider(label="Exercise Induced Angina", choices = ["yes","no"])