【发布时间】:2021-08-30 23:29:48
【问题描述】:
我正在使用递归特征消除 (RFE) 管道:
from sklearn.feature_selection import RFE
c_GAUSS = GaussianProcessClassifier()
rfe = RFE(estimator=c_GAUSS)
但是,我得到一个错误:
ValueError: when `importance_getter=='auto'`, the underlying
estimator GaussianProcessClassifier should have `coef_` or
`feature_importances_` attribute. Either pass a fitted estimator to
feature selector or call fit before calling transform.
使用 SVC,我刚刚解决了这个问题,方法是在 SVC 中添加一个系数 c_SVC = SVC(C = 1)。
由于 GPC 没有系数,这里有什么可能的解决方法吗?
【问题讨论】:
标签: python scikit-learn