我想知道,当使用管道中的分类器进行预处理时,如何从scikit learn中的随机林中提取具有特征名的特征重要性。在
这里的问题是只提取特征重要性:How to extract feature importances from an Sklearn pipeline
从我所做的简短研究来看,这在scikit learn中似乎不可能实现,但我希望我错了。在
我还发现了一个名为ELI5(https://eli5.readthedocs.io/en/latest/overview.html)的包,它应该用scikit learn解决这个问题,但它没有解决我的问题,因为为我输出的特性名称是x1、x2等,而不是实际的特性名称。在
作为一种解决方法,我在管道之外完成了所有的预处理,但是我很想知道如何在管道中进行预处理。在
如果我能提供任何有用的代码,请在评论中告诉我。在
Xgboost有一个示例,用于获取功能重要性:
相关问题 更多 >
编程相关推荐