mirror of
https://github.com/webclinic017/drift.git
synced 2026-07-27 18:57:55 +00:00
fix(Selection): use step size of 5, speeding up feature selection by 5x (overall 3x improvement) (#115)
This commit is contained in:
committed by
GitHub
parent
9488e92597
commit
d87389a135
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user