I am trying to make a logistic regression model with RFE feature selection.
weights = {0:1, 1:5}
model = LogisticRegression(solver='lbfgs', max_iter=5000, class_weight=weights)
rfe = RFE(model, 25)
rfe_model = rfe.fit(X_train, y_train)
print(rfe_model.support_)
print(selector.ranking_)
And I get:
array([ True, True, True, True, True, False, False, False, False, False])
array([1, 1, 1, 1, 1, 6, 4, 3, 2, 5])
How can I use rfe_model.support_ to extract the list of chosen features (subset the data frame) and make a model with only those features (except manually, by making a for loop ad subsetting the list of features itself)? Is there a more elegant way?
Bonus question: Where can I find more info regarding feature selection for logistic regression (not including backward, forwards and stepwise method)?