【发布时间】:2018-12-21 11:17:33
【问题描述】:
from xgboost import plot_importance
from matplotlib import pyplot
plot_importance(model)
pyplot.show()
我在 xgboost 模型中安装了 150 个特征,想打印出所有特征的重要性,但是打印出来的东西很乱。
【问题讨论】:
标签: python pandas matplotlib
from xgboost import plot_importance
from matplotlib import pyplot
plot_importance(model)
pyplot.show()
我在 xgboost 模型中安装了 150 个特征,想打印出所有特征的重要性,但是打印出来的东西很乱。
【问题讨论】:
标签: python pandas matplotlib
您可以仅使用
绘制最重要的特征plot_importance(model, max_num_features=10)
或者你可以增加地块大小
fig, ax = plt.subplots(figsize=(h, w))
xgboost.plot_importance(model, ax=ax)
如How to change size of plot in xgboost.plot_importance? 中所述。
【讨论】: