Reputation: 1038
I am using the recursive feature ranking function i scikit-learn (http://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.RFECV.html#sklearn.feature_selection.RFECV). However, I would like use a LDA classifier as the estimator. I have this code:
X, y = make_friedman1(n_samples=50, n_features=10, random_state=0)
estimator = LDA()
#selector = RFE(estimator,5,step = 1)
selector = RFECV(estimator, cv = 5,step = 1)
selector=selector.fit(X,y)
print selector.support_
print selector.ranking_
When I execute this code, I am getting an error. If I execute the same code with RFE, it is ok. Or if I use the SVR classifier, it works ok. My question is if I am getting a classifier when I call the method LDA().The RFECV will use the classifier in the "estimator" to rank the features. What is the problem with LDA?
Upvotes: 0
Views: 557