Reputation: 1
In the SHAP force plot, is there a way to change the value of the x-axis to a custom name?
f = plt.figure(figsize=(8, 6))
shap.summary_plot(shap_values, X_test, plot_type="bar", feature_names=X_train.columns, class_names = ORGD_Test['Class'])
Upvotes: 0
Views: 1390
Reputation: 1
If you wanna change the feature font size,this code works for me:
shap.summary_plot(shap_values, show=False)
# Get the current figure and axes objects.
fig, ax = plt.gcf(), plt.gca()
for text in ax.texts:
text.set_fontsize( your_font_size_number)
plt.show()
Upvotes: 0
Reputation: 436
shap.summary_plot(shap_values, show=False)
# Get the current figure and axes objects.
fig, ax = plt.gcf(), plt.gca()
# Set the limits for the x-axis and similarly can be done for the y-axis also
ax.set_xlim(-60, 125)
ax.set_xlim(-60, 125)
ax.set_title(ax_title, fontdict={"size":font_size})
Upvotes: 0