Spaces:
Runtime error
Runtime error
try to fix force plot
Browse files
app.py
CHANGED
@@ -172,12 +172,13 @@ with gr.Blocks() as demo:
|
|
172 |
|
173 |
fig4 = plt.figure(figsize=(3, 3))
|
174 |
plt.title("SHAP Force Plot")
|
175 |
-
|
176 |
shap.force_plot(
|
177 |
explainer.expected_value[predicted_class],
|
178 |
shap_values_for_predicted_class,
|
179 |
df.iloc[0],
|
180 |
feature_names=["age", "bmi", "hba1c", "glucose"],
|
|
|
181 |
)
|
182 |
|
183 |
# fig4 = plt.figure(figsize=(3, 3))
|
|
|
172 |
|
173 |
fig4 = plt.figure(figsize=(3, 3))
|
174 |
plt.title("SHAP Force Plot")
|
175 |
+
shap.initjs()
|
176 |
shap.force_plot(
|
177 |
explainer.expected_value[predicted_class],
|
178 |
shap_values_for_predicted_class,
|
179 |
df.iloc[0],
|
180 |
feature_names=["age", "bmi", "hba1c", "glucose"],
|
181 |
+
matplotlib=True,
|
182 |
)
|
183 |
|
184 |
# fig4 = plt.figure(figsize=(3, 3))
|