In SHAP force plot, is there a way to change the value of x-axis to custom name?

1k views Asked by At

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']) 
1

There are 1 answers

0
Snehal Rajput On
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})