machine-learning - xgboost get_fscore() 或 get_score() 返回更少的列数

标签 machine-learning xgboost

我正在尝试使用 xgboost 绘制特征重要性。 下面的代码显示了问题。 len(dtrain.feature_names), len(model.get_score().values()), len(model.get_fscore().values()) (289, 269, 269)

当我尝试获取分数时,其余 20 列发生了什么情况。 我是不是错过了什么。我对此非常天真。

最佳答案

这 20 个特征(列)从未在梯度提升决策树中被选择。换句话说,XGBoost 模型没有使用这 20 个特征。

关于machine-learning - xgboost get_fscore() 或 get_score() 返回更少的列数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43862499/

相关文章:

machine-learning - 机器学习中面向 future 的特征扩展?

R 预测模型 预测原因和倾向 %

python - 预处理机器学习数据

maps - 寻找有关多部分图形手势识别的指导

python - XGBoostError : Check failed: typestr. size() == 3(2 对 3): `typestr' 的格式应为 <endian><type><size of type in bytes>

python - 在 xgboost 上使用 shap 时出现 UnicodeDecodeError

hadoop - 在 Google Cloud Dataproc 上运行 xgboost

machine-learning - word2vec如何从向量中获取单词?

python - 使用 XGboost 进行不平衡分类时如何使用下采样和配置类权重参数?

r - xgb.DMatrix 错误 : The length of labels must equal to the number of rows in the input data