-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
fixing issue #7474 fix selectFDR bug. #7509
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert to the two-line syntax to be pep8 compatible. i.e. line length < 80.
…dr_regression needs change. Seems to fail randomly
@fabianegli : fixed pep8 problems. But looks like a test might fail randomly.. will test a few times and update the test case too if needed. |
8000
Can't reproduce failure of test_select_fdr_regression test case. after about 10 repeated runs of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use pep8 to check locally for pep8 compliance.
pip install pep8
and then use it pep8 univariate_selection.py
@@ -596,7 +596,9 @@ def _get_support_mask(self): | |||
|
|||
n_features = len(self.pvalues_) | |||
sv = np.sort(self.pvalues_) | |||
selected = sv[sv <= float(self.alpha) / n_features * (np.arange(n_features) + 1)] | |||
selected = sv[sv <= float(self.alpha) / n_features |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put the *
operator at the end of the line instead of the start of the following line.
@@ -596,7 +596,9 @@ def _get_support_mask(self): | |||
|
|||
n_features = len(self.pvalues_) | |||
sv = np.sort(self.pvalues_) | |||
selected = sv[sv <= float(self.alpha) / n_features * (np.arange(n_features) + 1)] | |||
selected = sv[sv <= float(self.alpha) / n_features | |||
* (np.arange(n_features) + 1)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent this line to align with the opening square bracket.
selected = sv[sv <= float(self.alpha) / n_features * (np.arange(n_features) + 1)] | ||
selected = sv[sv <= float(self.alpha) / n_features | ||
* (np.arange(n_features) + 1)] | ||
print(selected) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't print.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops.. that was in preparation for testing and fixing test-case.. never needed and I forgot.. fixed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plese check and fix the tho other comments as well.
selected = sv[sv <= float(self.alpha) / n_features *
(np.arange(n_features) + 1)]
@@ -597,7 +597,7 @@ def _get_support_mask(self): | |||
n_features = len(self.pvalues_) | |||
sv = np.sort(self.pvalues_) | |||
selected = sv[sv <= float(self.alpha) / n_features | |||
* np.arange(n_features)] | |||
8000 * (np.arange(n_features) + 1)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be np.arange(1, n_features + 1)
?
@anandjeyahar given the existing PR to fix this issue, and that it is a straightforward issue, would you mind closing it? |
Reference Issue
Fixes selectFDR bug #7474
What does this implement/fix? Explain your changes.
ANOVA selector is made more cleaner.
Any other comments?
This change is