【问题标题】:matplotlib:how to show all features(about 150 ones) clearlymatplotlib:如何清楚地显示所有特征(大约 150 个)
【发布时间】: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


    【解决方案1】:

    您可以仅使用

    绘制最重要的特征
    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? 中所述。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-10-13
      • 1970-01-01
      • 2021-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-25
      相关资源
      最近更新 更多