【问题标题】:XGBoost get feature importance as a list of columns instead of plotXGBoost 将特征重要性作为列列表而不是绘图
【发布时间】:2020-11-13 12:58:00
【问题描述】:

我想知道我们是否可以将特征重要性作为列列表而不是图来获取。这就是我所拥有的

xg_reg = xgb.train(params=params, dtrain=data_dmatrix, num_boost_round=10)
import matplotlib.pyplot as plt

xgb.plot_importance(xg_reg)
plt.rcParams['figure.figsize'] = [5,5]
plt.show()

这给了我这个情节

我想获得一个顶级功能列表,因为我有 800 多个不同的功能。

【问题讨论】:

    标签: machine-learning scikit-learn xgboost


    【解决方案1】:

    您可以使用xgb.get_score()。以下是一些示例:How to get feature importance in xgboost?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-19
      • 2019-12-13
      • 2017-01-15
      • 1970-01-01
      • 2021-06-02
      • 2020-08-20
      • 2019-04-15
      • 1970-01-01
      相关资源
      最近更新 更多