8000 MRG FIX for iid weighting in grid-search by amueller · Pull Request #1731 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

MRG FIX for iid weighting in grid-search #1731

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

Conversation

amueller
Copy link
Member
@amueller amueller commented Mar 3, 2013

This is a fix for the iid weighting in GridSearchCV. It could be that I screwed this up before, but didn't notice as there was no test.

@@ -146,7 +146,7 @@ estimator during the construction and exposes an estimator API::
>>> clf.fit(X_digits[:1000], y_digits[:1000]) # doctest: +ELLIPSIS
GridSearchCV(cv=None,...
>>> clf.best_score_
0.988991985997974
0.98899999999999999
Copy link
Member

Choose a reason for hiding this comment

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

We will get rounding errors: computers have finite precisions. We cannot expect all platform to round stuff exactly the same way at the 17th place, can we? I think we should expect:

0.9889999999999...             # doctest: +ELLIPSIS

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, then I'll change all the tests in the file...

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 other numbers in the file seemed not to be periodic, so I kept them.

@ogrisel
Copy link
Member
ogrisel commented Mar 3, 2013

That looks good. Maybe @agramfort can you check this fix? I think you were the original author of the iid flag.

@amueller
Copy link
Member Author
amueller commented Mar 5, 2013

rebased to fix merging trouble

X, y = make_blobs(centers=[[0, 0], [1, 0], [0, 1], [1, 1]], random_state=0,
cluster_std=0.1, shuffle=False, n_samples=80)
# split dataset into two folds that are not iid
# first on contains data of all 4 blobs, second only from two.
Copy link
Member

Choose a reason for hiding this comment

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

typo on=one

@jaquesgrobler
Copy link
Member

This all looks well to me and the test is good too. it's ready for merge, right? :)

@amueller
Copy link
Member Author

Yes, should be good. I agree with @ogrisel that it would be nice to have @agramfort's 👍 but I'm not sure he is available / has time.

@agramfort
Copy link
Member

merged by rebase after fixing the typo.

@agramfort agramfort closed this Mar 15, 2013
@amueller
Copy link
Member Author

Thanks :)

@amueller amueller deleted the gridsearch_n_samples_test branch March 15, 2013 09:25
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.

4 participants
0