Skip to content

[MRG+1] Disabled randomized_svd warning when number of iterations is no… #6749

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

Merged
merged 1 commit into from
May 9, 2016

Conversation

jordisoler
Copy link
Contributor

Disabled randomized_svd warning when number of iterations is not specified (#6746)

"achieve higher precision.")
if n_iter_specified:
warnings.warn("The number of power iterations is increased to "
"7 to achieve higher precision.")
Copy link
Member

Choose a reason for hiding this comment

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

style: can you please fix the indentation level?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry to be late, I will check it carefully next time

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 that be the opposite? It should be raise when it was not specified!

Copy link
Member

@amueller amueller Jul 8, 2016

Choose a reason for hiding this comment

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

wait why are we changing n_iter here if it was explicitly given? I don't understand the logic. We should do either a good default or we should do what the user said. If the user provided n_iter we should do what she said IMHO.

@ogrisel
Copy link
Member

ogrisel commented May 9, 2016

+1 for merge. Thanks @jordisoler.

@ogrisel ogrisel changed the title [MRG] Disabled randomized_svd warning when number of iterations is no… [MRG+1] Disabled randomized_svd warning when number of iterations is no… May 9, 2016
@@ -349,6 +349,13 @@ def randomized_svd(M, n_components, n_oversamples=10, n_iter=4,
n_random = n_components + n_oversamples
n_samples, n_features = M.shape

if n_iter == None:
Copy link
Member

Choose a reason for hiding this comment

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

if n_iter is None

Even if that doesn't make such a big difference, this is the usual way of comparing against None.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! Sorry for that, and thanks

@giorgiop
Copy link
Contributor

giorgiop commented May 9, 2016

LGTM

@agramfort agramfort merged commit a4d070e into scikit-learn:master May 9, 2016
@agramfort
Copy link
Member

will fix the indent in master.

thx @jordisoler

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.

6 participants