-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG] scorer: add sample_weight support (+test) #3401
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
Conversation
The test is simple but the change is equally simple, just passing the |
|
||
for name, scorer in SCORERS.items(): | ||
try: | ||
weighted = scorer(estimator[name], X_test, y_test, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather have a more explicit test. For example having for the regressor [0, 0, 1, 1, 2, 2] as output and then using weights=[0, 0, 1, 1, 0, 0] and once 1-weights and check that the expected thing happens.
LGTM when travis is green. |
All reactions
Sorry, something went wrong.
lgtm |
All reactions
Sorry, something went wrong.
Thanks a lot for taking this over @vene! I've had no time to work on this lately. |
All reactions
Sorry, something went wrong.
ignored = scorer(estimator[name], X_test[10:], y_test[10:]) | ||
unweighted = scorer(estimator[name], X_test, y_test) | ||
assert_not_equal(weighted, unweighted, | ||
"scorer {} behaves identically when called with " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support for Py2.6 means we can't use {}
. Use {0}
, {1}
, {2}
, ...
Sorry, something went wrong.
All reactions
Not much to do to get that merged. |
All reactions
Sorry, something went wrong.
Travis is happy ! merging |
All reactions
Sorry, something went wrong.
[MRG] scorer: add sample_weight support (+test)
Thanks! 🍻 |
All reactions
Sorry, something went wrong.
I'm glad to see this moving through. Thanks Noel and Vlad. I look forward On 20 July 2014 07:47, Noel Dawe notifications@github.com wrote:
|
All reactions
Sorry, something went wrong.
Successfully merging this pull request may close these issues.
Wraps up #3098 (a part of #1574), ready for review.
Initial description by @ndawe: