- 当RFE+linear SVC时,没有问题
clf_1 = SVC(kernel='linear',random_state=0)
rfe = RFE(estimator=clf_1, n_features_to_select=12, step=1)
rfe.fit(X, y)
print(rfe.ranking_)
print(rfe.support_)
- 当RFE+rbf SVC时,会出现问题如下
RuntimeError: The classifier does not expose "coef_" or "feature_importances_" attributes
- 原因
这个帖子的回答: