We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c5aaeb commit 1461daeCopy full SHA for 1461dae
dev/_sources/auto_examples/inspection/plot_permutation_importance.rst.txt
@@ -48,6 +48,7 @@ can mitigate those limitations.
48
49
print(__doc__)
50
import matplotlib.pyplot as plt
51
+ import matplotlib.ticker as mticker
52
import numpy as np
53
54
from sklearn.datasets import fetch_openml
@@ -222,6 +223,7 @@ importances:
222
223
y_ticks = np.arange(0, len(feature_names))
224
fig, ax = plt.subplots()
225
ax.barh(y_ticks, tree_feature_importances[sorted_idx])
226
+ ax.yaxis.set_major_locator(mticker.FixedLocator(feature_names[sorted_idx]))
227
ax.set_yticklabels(feature_names[sorted_idx])
228
ax.set_yticks(y_ticks)
229
ax.set_title("Random Forest Feature Importances (MDI)")
0 commit comments