1
from xgboost import plot_importance
from matplotlib import pyplot
plot_importance(model)
pyplot.show()

I got 150 features fitted into xgboost model and want to print out all the feature importance, however something mess printed out.

enter image description here

Leon
  • 389
  • 1
  • 4
  • 14

1 Answers1

1

You could either only plot the most important features with

plot_importance(model, max_num_features=10)

or you could increase the plot size with

fig, ax = plt.subplots(figsize=(h, w))
xgboost.plot_importance(model, ax=ax)

as described in How to change size of plot in xgboost.plot_importance?.

bet.bom
  • 196
  • 5