mertkarabacak
commited on
Commit
•
2ec1d6c
1
Parent(s):
2120987
Upload app.py
Browse files
app.py
CHANGED
@@ -195,13 +195,15 @@ def y1_interpret_xgb(*args):
|
|
195 |
shap_values = y1_explainer_xgb.shap_values(xgb.DMatrix(df, enable_categorical=True))
|
196 |
fig_y1 = shap.bar_plot(shap_values[0], max_display = 10, show = False, feature_names = f_names)
|
197 |
fig_y1 = plt.gcf()
|
198 |
-
ax_y1 = plt.gca()
|
199 |
fig_y1.set_figheight(6)
|
200 |
fig_y1.set_figwidth(6)
|
|
|
201 |
plt.xlabel("SHAP value (impact on model output)", fontsize =12, fontweight = 'heavy', labelpad = 8)
|
202 |
plt.tick_params(axis="y",direction="out", labelsize = 12)
|
203 |
plt.tick_params(axis="x",direction="out", labelsize = 12)
|
204 |
plt.tight_layout()
|
|
|
|
|
205 |
return fig_y1
|
206 |
|
207 |
def y1_interpret_lgb(*args):
|
|
|
195 |
shap_values = y1_explainer_xgb.shap_values(xgb.DMatrix(df, enable_categorical=True))
|
196 |
fig_y1 = shap.bar_plot(shap_values[0], max_display = 10, show = False, feature_names = f_names)
|
197 |
fig_y1 = plt.gcf()
|
|
|
198 |
fig_y1.set_figheight(6)
|
199 |
fig_y1.set_figwidth(6)
|
200 |
+
ax_y1 = plt.gca()
|
201 |
plt.xlabel("SHAP value (impact on model output)", fontsize =12, fontweight = 'heavy', labelpad = 8)
|
202 |
plt.tick_params(axis="y",direction="out", labelsize = 12)
|
203 |
plt.tick_params(axis="x",direction="out", labelsize = 12)
|
204 |
plt.tight_layout()
|
205 |
+
wrap_labels(ax_y1, 30)
|
206 |
+
ax_y1.figure
|
207 |
return fig_y1
|
208 |
|
209 |
def y1_interpret_lgb(*args):
|