8000 Fixes #4632: Add weighted_test_score option to sklearn model selection module by algoGuruZ · Pull Request #10800 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

Fixes #4632: Add weighted_test_score option to sklearn model selection module #10800

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
wants to merge 5 commits into from

Conversation

algoGuruZ
Copy link

Reference Issues/PRs

Fixes #4632

What does this implement/fix? Explain your changes.

Add weighted_test_score option so that user can choose to specify whether CV score is weighted or un-weighted. This is very important to certain fields of research, e.g. finance. For now, it is silently default to un-weighted, which is a little undesirable.

Any other comments?

The current fix deals with pipeline as well as regular sklearn estimators.

@sklearn-lgtm
Copy link

This pull request introduces 2 alerts when merging 8a0af5e into 47ce5e1 - view on lgtm.com

new alerts:

  • 2 for Potentially uninitialized local variable

Comment posted by lgtm.com

@algoGuruZ algoGuruZ changed the title Add weighted_test_score option to sklearn model selection module Fixes #4632: Add weighted_test_score option to sklearn model selection module Mar 12, 2018
Copy link
Member
@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

Thanks. A few points:

  • cross_validation.py and grid_search.py will disappear before the next release, so please revert any changes there
  • The API needs to be explicit, rather than magically finding fit parameters with a relevant suffix. For instance, weighted_test_score could accept the param name if it is not plain old sample_weight
  • We have been exploring generic solutions to this issue for a long time ([API] Consistent API for attaching properties to samples #4497 and related). I'd rather see one of those implemented, but would consider this kind of specific solution in the meantime
  • This needs tests

@algoGuruZ
Copy link
Author

Thanks for the comments. Let me work on the suggested points above.

@algoGuruZ
Copy link
Author

This PR is superseded by #10806.

@algoGuruZ algoGuruZ closed this Mar 13, 2018
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.

Should cross-validation scoring take sample-weights into account?
3 participants
0