8000 fixing issue #7474 fix selectFDR bug. by anandjeyahar · Pull Request #7509 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
wants to merge 3 commits into from
Closed

fixing issue #7474 fix selectFDR bug. #7509

wants to merge 3 commits into from

Conversation

anandjeyahar
Copy link
@anandjeyahar anandjeyahar commented Sep 28, 2016

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 Reviewable

Copy link
Contributor
@fabianegli fabianegli left a 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
@anandjeyahar
Copy link
Author

@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.

@anandjeyahar
Copy link
Author
8000

Can't reproduce failure of test_select_fdr_regression test case. after about 10 repeated runs of
nosetests --with-coverage ./sklearn/tests/. . Considering it a spurious case.

Copy link
Contributor
@fabianegli fabianegli left a 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
Copy link
Contributor

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)]
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't print.

Copy link
Author

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.

Copy link
Contributor

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)]

@nelson-liu
Copy link
Contributor

seem like @mpjlu was also working on this at #7490

@@ -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)]
Copy link
Member

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)?

@jnothman
Copy link
Member

@anandjeyahar given the existing PR to fix this issue, and that it is a straightforward issue, would you mind closing it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0