nicojara commited on
Commit
1dbb401
·
verified ·
1 Parent(s): 13acef6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -14,7 +14,7 @@ explainer = shap.Explainer(loaded_model) # PLEASE DO NOT CHANGE THIS.
14
 
15
  # Create the main function for server
16
  def main_func(age, education_num, sex, capital_gain, capital_loss, hours_per_week, salary_class):
17
- sex = 0 if sex == "Male" else 1
18
  new_row = pd.DataFrame.from_dict({'age':age,
19
  'education-num':education_num,'sex':sex,'capital-gain':capital_gain,
20
  'capital-loss':capital_loss, 'hours-per-week':hours_per_week,'salary-class':salary_class},
@@ -61,7 +61,7 @@ with gr.Blocks(title=title) as demo:
61
  submit_btn = gr.Button("Analyze")
62
 
63
  with gr.Column(visible=True) as output_col:
64
- label = gr.Label(label="Predicted Probabilities")
65
  local_plot = gr.Plot(label="Top SHAP Features")
66
 
67
  submit_btn.click(
 
14
 
15
  # Create the main function for server
16
  def main_func(age, education_num, sex, capital_gain, capital_loss, hours_per_week, salary_class):
17
+ sex = 1 if sex == "Female" else 0
18
  new_row = pd.DataFrame.from_dict({'age':age,
19
  'education-num':education_num,'sex':sex,'capital-gain':capital_gain,
20
  'capital-loss':capital_loss, 'hours-per-week':hours_per_week,'salary-class':salary_class},
 
61
  submit_btn = gr.Button("Analyze")
62
 
63
  with gr.Column(visible=True) as output_col:
64
+ label = gr.Label(label="Predicted Income")
65
  local_plot = gr.Plot(label="Top SHAP Features")
66
 
67
  submit_btn.click(