saad177 commited on
Commit
bd29ef5
1 Parent(s): ca9891a

fix layout size

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -145,7 +145,7 @@ with gr.Blocks() as demo:
145
  values=shap_values_for_predicted_class[0],
146
  base_values=explainer.expected_value[predicted_class],
147
  data=transformed_df[0],
148
- feature_names=df.columns.tolist(),
149
  )
150
 
151
  fig2 = plt.figure(figsize=(4, 2)) # Create a new figure for SHAP plot
@@ -153,7 +153,7 @@ with gr.Blocks() as demo:
153
  plt.title("SHAP Waterfall Plot") # Optionally set a title for the SHAP plot
154
  plt.tight_layout()
155
  # plt.xticks(rotation=90)
156
- plt.yticks(rotation=90)
157
  shap.waterfall_plot(
158
  shap_explanation
159
  ) # Set show=False to prevent immediate display
 
145
  values=shap_values_for_predicted_class[0],
146
  base_values=explainer.expected_value[predicted_class],
147
  data=transformed_df[0],
148
+ feature_names=["age", "bmi", "hba1c", "glucose"],
149
  )
150
 
151
  fig2 = plt.figure(figsize=(4, 2)) # Create a new figure for SHAP plot
 
153
  plt.title("SHAP Waterfall Plot") # Optionally set a title for the SHAP plot
154
  plt.tight_layout()
155
  # plt.xticks(rotation=90)
156
+ plt.yticks(rotation=45)
157
  shap.waterfall_plot(
158
  shap_explanation
159
  ) # Set show=False to prevent immediate display