rfe

Python – constrain values within interquartile range

Python – constrain values within interquartile range Question: I am able to get this to run piecemeal, but when I tried a for loop to run it across all the models I am getting an error. It looks like I am giving a list of 1 rather than the item. How do I get it …

Total answers: 1

Recursive feature elimination (RFE) with random forest

Recursive feature elimination (RFE) with random forest Question: I want to use Recursive feature elimination (RFE) for feature selection on my datase using random forest. I came up with this code: from sklearn.feature_selection import RFE # Create the RFE object and rank each pixel clf_rf_3 = RandomForestClassifier() rfe = RFE(estimator=clf_rf_3, n_features_to_select=6, step=1) rfe = rfe.fit(X_train, …

Total answers: 1

Target transformation and feature selection in scikit-learn

Target transformation and feature selection in scikit-learn Question: I am using RFECV for feature selection in scikit-learn. I would like to compare the result of a simple linear model (X,y) with that of a log transformed model (using X, log(y)) Simple Model: RFECV and cross_val_score provide the same result (we need to compare the average …

Total answers: 2

ValueError using recursive feature elimination for SVM with rbf kernel in scikit-learn

ValueError using recursive feature elimination for SVM with rbf kernel in scikit-learn Question: I’m trying to use the recursive feature elimination (RFE) function in scikit-learn but keep getting the error ValueError: coef_ is only available when using a linear kernel. I am trying to perform feature selection for a support vector classifier (SVC) using a …

Total answers: 1