diff --git a/mlxtend/feature_selection/sequential_feature_selector.py b/mlxtend/feature_selection/sequential_feature_selector.py index b65c0f696..b18c30742 100644 --- a/mlxtend/feature_selection/sequential_feature_selector.py +++ b/mlxtend/feature_selection/sequential_feature_selector.py @@ -382,7 +382,8 @@ def fit(self, X, y, custom_feature_names=None, groups=None, **fit_params): else: select_in_range = False - k_to_select = self.k_features + k_to_select = int(len(X[1])**.5) + np.take(X, np.random.permutation(X.shape[1]), axis=1, out=X) orig_set = set(range(X_.shape[1])) n_features = X_.shape[1]