fix(Selection): use step size of 5, speeding up feature selection by 5x (overall 3x improvement) (#115)

This commit is contained in:
Mark Aron Szulyovszky
2022-01-06 18:13:19 +01:00
committed by GitHub
parent 9488e92597
commit d87389a135
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ def __select_features(X: pd.DataFrame, y: pd.Series, model: Model, n_features_to
feat_selector_model = backup_model.model
# selector = RFECV(feat_selector_model, cv = cv, step=5, min_features_to_select=min_features_to_select)
selector = RFE(feat_selector_model, n_features_to_select= n_features_to_select)
selector = RFE(feat_selector_model, n_features_to_select= n_features_to_select, step=5)
selector = selector.fit(X_scaled, y)
print("Kept %d features out of %d" % (selector.n_features_, X_scaled.shape[1]))
+2 -1
View File
@@ -1,4 +1,5 @@
from sklearn.linear_model import LinearRegression, Lasso, BayesianRidge, LogisticRegression, Ridge
from sklearn.linear_model import LinearRegression, Lasso, BayesianRidge, Ridge
from sklearnex.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier
from sklearnex.neighbors import KNeighborsRegressor, KNeighborsClassifier
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis