Skip to content

Commit 1461dae

Browse files
authored
Update plot_permutation_importance.rst.txt
1 parent 4c5aaeb commit 1461dae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dev/_sources/auto_examples/inspection/plot_permutation_importance.rst.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ can mitigate those limitations.
4848
4949
print(__doc__)
5050
import matplotlib.pyplot as plt
51+
import matplotlib.ticker as mticker
5152
import numpy as np
5253
5354
from sklearn.datasets import fetch_openml
@@ -222,6 +223,7 @@ importances:
222223
y_ticks = np.arange(0, len(feature_names))
223224
fig, ax = plt.subplots()
224225
ax.barh(y_ticks, tree_feature_importances[sorted_idx])
226+
ax.yaxis.set_major_locator(mticker.FixedLocator(feature_names[sorted_idx]))
225227
ax.set_yticklabels(feature_names[sorted_idx])
226228
ax.set_yticks(y_ticks)
227229
ax.set_title("Random Forest Feature Importances (MDI)")

0 commit comments

Comments
 (0)