Is there a way to use recursive feature selection with non linear models with scikit-learn?

允我心安 提交于 2019-12-08 03:53:00

问题


I am trying to use SVR with an rbf kernel (obviously) on a regression problem. My dataset has something like 300 features. I would like to select more relevant features and use something like the sequentialfs function of matlab which would try every combination (or anyway starting with few variables and adding variables on the way, or the opposite, going backward, like the RFE or RFECV of scikit)).

Now, as said, for python there is the RFE but I can't use it with a non linear estimator. Is there anything I am not aware about which would allow me to use the RFE with a non linear estimator? I suppose it wouldn't be difficult to write an algorithm that does that, but if there is already something which does the job it would be definitely better.

Thank you as always ;)


回答1:


RFE must have some way of determining the feature importances and RBF kernel SVMs don't provide that. From a quick glance at the original algorithm, I get the impression that an implementation for kernel SVMs would have to integrated into the SVM learning algorithm.

Stepwise (forward or backward) feature selection would be easy to implement, but is not available as a pre-built estimator in scikit-learn.



来源:https://stackoverflow.com/questions/22255881/is-there-a-way-to-use-recursive-feature-selection-with-non-linear-models-with-sc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!