8000 MRG Fix changing params test by amueller · Pull Request #1670 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

MRG Fix changing params test #1670

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 0 commits into from
Feb 11, 2013

Conversation

amueller
Copy link
Member

There was a stupid bug in the test for checking that estimators don't change their __init__ params: it was only done for classifiers and clustering algos.
This is a fix for regressors and transformers. I left out GaussianProcessRegressor since I couldn't figure out what was happening there (corr seemed to be a string, then a callable, then a number).

These fixes are needed to make #1669 work. Any ideas what I should put into whatsnew?

@amueller amueller mentioned this pull request Feb 10, 2013
or name in ['CCA', 'PLSCanonical', 'PLSRegression',
'PLSSVD', 'GaussianProcess']):
# FIXME!
# in particular GAussianProcess!!!!!
Copy link
Member

Choose a reason for hiding this comment

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

Typo => GaussianProcess and also avoid multiple punctuation. This codebase is a quiet working place, people need a calm environment to focus ;)

But I agree that GaussianProcess constructor params handling is very inconsistent with the rest of the code base and need a fix.

@ogrisel
Copy link
Member
ogrisel commented Feb 10, 2013

+1 for merging once minor comments are addressed.

@ogrisel
Copy link
Member
ogrisel commented Feb 10, 2013

BTW thanks for working on this.

@amueller
Copy link
Member Author

Thank for the very quick review. I removed the exclamation marks, fixed some minor problems and force-pushed again. Hope Travis is happy now.

@amueller
Copy link
Member Author

Well @FedericoV told me that his pickle tests don't pass because the random_state is somehow altered. As I specifically added the test for this, I quitetly thought to myself fuuuu

@amueller
Copy link
Member Author

Ok, build finally passed Travis. Should be good to go.

@ogrisel
Copy link
Member
ogrisel commented Feb 10, 2013

I quitetly thought to myself

Nice and quiet indeed :)

* self.random_state.normal(size=(n_features,
self.n_components)))
self.random_weights_ = (np.sqrt(self.gamma) * random_state.normal(
size=(n_features, self.n_components)))
Copy link
Member

Choose a reason for hiding this comment

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

More indentation please :). It's prettier.

Copy link
Member Author

Choose a reason for hiding this comment

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

That would make flake8 complain, though :-/

Copy link
Member Author

Choose a reason for hiding this comment

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

I can redo it a bit, though.

Copy link
Member Author

Choose a reason for hiding this comment

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

The only other accepted solution is

        self.random_weights_ = (np.sqrt(self.gamma)
                                * random_state.normal(size=
                                                      (n_features,
                                                       self.n_components)))

which I dont think is very pretty

@GaelVaroquaux
Copy link
Member

👍 for merge. Thanks, this is extremely useful.

@amueller amueller merged commit 6920295 into scikit-learn:master Feb 11, 2013
@amueller
Copy link
Member Author

Merged by rebase. Thanks for the quick reviews :)

@amueller amueller deleted the fix_changing_prams_test branch February 11, 2013 16:14
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.

3 participants
0