首页 > 解决方案 > 对于 XGBoost 有没有办法在每个推理的基础上找到特征重要性

问题描述

我正在使用 XGBRegressor 模型,并且能够通过访问以下内容从整体上查看我的哪些功能最具预测性:

clf.feature_importances_

但是,我在网上阅读应该可以找到对特定推理最重要的特征。

one_data_point = ...
clf.predict([one_data_point])[0].feature_importances_  # Doesn't work obviously

这似乎是决策树所走路径的一些积累。有没有办法做到这一点?

标签: pythonmachine-learningdecision-treexgboost

解决方案


推荐阅读