python - 对于 XGBoost 有没有办法在每个推理的基础上找到特征重要性
问题描述
我正在使用 XGBRegressor 模型,并且能够通过访问以下内容从整体上查看我的哪些功能最具预测性:
clf.feature_importances_
但是,我在网上阅读应该可以找到对特定推理最重要的特征。
one_data_point = ...
clf.predict([one_data_point])[0].feature_importances_ # Doesn't work obviously
这似乎是决策树所走路径的一些积累。有没有办法做到这一点?
解决方案
推荐阅读
- xamarin - 如何使用自己的后台服务打开应用程序
- arrays - 找出一个数字的所有数字是否相等
- sql - 将个位数月份转换为两位数
- django - 无法连接到服务器:连接被拒绝 服务器是否在主机“数据库”(172.19.0.3) 上运行并接受端口 5432 上的 TCP/IP 连接?
- git - Ansible 可以使用 SCM (GIT) 保险库文件吗?
- python - 在 break 语句后将变量传递给迭代变量
- javascript - 尝试使用我自己的 ReactDataGrid 默认值制作可重用的 DataGrid 组件,但 Typescript 给了我错误
- r - 闪亮的 selectizeInput:读取当前文本
- c# - 将对象从构造函数添加到 ArrayList
- flutter - 按元素列出的 Dart 总和列表