关于#机器学习#的问题:XGBoost feature_importance_特征筛选后怎样应用特征(语言-python)

XGBoost feature_importance_特征筛选后怎样应用特征?根据accuracy选择出的特征怎样进一步分析?可以使用筛选出的变量再次构建xgb model吗?

可以造次构建xgb . 但是这个重要性也不一定准
可参考pca之类的算法

不知道你这个问题是否已经解决, 如果还没有解决的话:
  • 这篇博客: 树模型中的特征重要性(feature_importances_)中的 XGBoost 部分也许能够解决你的问题, 你可以仔细阅读以下内容或者直接跳转源博客中阅读:
    • 只有当树模型作为基学习器时Feature importance才被定义(booster=gbtree),其他如线性学习器(booster=gblinear)则没有该定义。
    • 参数importance_type(string, default “gain”), 其他取值有“weight”, “cover”, “total_gain” or “total_cover”.
    • weight:该特征被选为分裂特征的次数; gain: 该特征在它所有分裂使用中带来的平均增益; total_gain: 该特征在它所有分裂使用中带来的增益和; cover: 该特征在它所有分裂使用中的平均覆盖率(覆盖率:受分裂影响的样本数); total_cover: 该特征在它所有分裂使用中的总覆盖率.
    • xgboost python API文档地址:
    XGBoost Python API Reference
  • xgboost 参数完整文档github地址: XGBoost Parameters
  • xgboost文档原文引用:

”weight” is the number of times a feature appears in a tree
”gain” is the average gain of splits which use the feature
”cover” is the average coverage of splits which use the feature where coverage is defined as the number of samples affected by the split


如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^