Skip to content

MRG Fix changing params test - #1670

Merged
amueller merged 0 commit into
scikit-learn:masterfrom
amueller:fix_changing_prams_test
Feb 11, 2013
Merged

amueller merged 0 commit into
scikit-learn:masterfrom
amueller:fix_changing_prams_test

Conversation

@amueller

Copy link
Copy Markdown
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
Comment thread sklearn/tests/test_common.py Outdated

Copy link
Copy Markdown
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

ogrisel commented Feb 10, 2013

Copy link
Copy Markdown
Member

+1 for merging once minor comments are addressed.

@ogrisel

ogrisel commented Feb 10, 2013

Copy link
Copy Markdown
Member

BTW thanks for working on this.

@amueller

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

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

@ogrisel

ogrisel commented Feb 10, 2013

Copy link
Copy Markdown
Member

I quitetly thought to myself

Nice and quiet indeed :)

Comment thread sklearn/kernel_approximation.py Outdated

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

👍 for merge. Thanks, this is extremely useful.

@amueller
amueller merged commit 6920295 into scikit-learn:master Feb 11, 2013
@amueller

Copy link
Copy Markdown
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