我想在使用Keras模型和图层构建的模型上应用递归特征消除(RFE)。我跑的时候:
from sklearn.feature_selection import RFE
## building Keras model ... #
rfe = RFE(model, 3)
rfe = rfe.fit(X_train, y_train)
我收到以下错误:
TypeError: Cannot clone object '<keras.models.Sequential object at 0x7f1ab93eb510>' (type <class 'keras.models.Sequential'>): it does not seem to be a scikit-learn estimator as it does not implement a 'get_params' methods.
我试图通过clone_model(model)
克隆我的Keras模型,但它没有帮助。
我是否必须使用sklearn估算器才能使用RFE?