Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random subsampling for feature selection #47 #650

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
15th attempt
  • Loading branch information
xliu833 committed Dec 21, 2019
commit 2dc146ea520c20f2a4c355a348afcc0a743f6006
3 changes: 2 additions & 1 deletion mlxtend/feature_selection/sequential_feature_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) # random subsample of sqrt(k_features) dimensions
np.take(X, np.random.permutation(X.shape[1]), axis = 1, out = X) # shuffle matrix horizontally

orig_set = set(range(X_.shape[1]))
n_features = X_.shape[1]
Expand Down