Spaces:
Runtime error
Runtime error
fix layout size
Browse files
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=
|
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=
|
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
|