Skip to content

TST check sample_weight shape added to common tests #11598

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

Conversation

sergulaydore
Copy link
Contributor

Reference Issues/PRs

Fixes #9926 (Ensure that the shape of sample_weight is checked in all the functions)

What does this implement/fix? Explain your changes.

I added a new check that makes sure an error is raised if the shape of the sample_weight is different than the sample size. Two estimators were missing the test so I added a test to those estimators.

Any other comments?

No

@rth rth self-requested a review February 5, 2020 21:18
@rth rth changed the title check sample_weight shape added TST check sample_weight shape added Feb 21, 2020
Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Thanks @sergulaydore and sorry this didn't get much review at the time.

I pushed a few changes to take into account updates in the code base and removed a few checks made redundant by this common check.

@rth rth requested a review from glemaitre February 21, 2020 13:49
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Thank you for working on this @sergulaydore !

LGTM

@thomasjpfan thomasjpfan changed the title TST check sample_weight shape added TST check sample_weight shape added to common tests Feb 21, 2020
@thomasjpfan thomasjpfan merged commit 78dc597 into scikit-learn:master Feb 21, 2020
thomasjpfan pushed a commit to thomasjpfan/scikit-learn that referenced this pull request Feb 22, 2020
panpiort8 pushed a commit to panpiort8/scikit-learn that referenced this pull request Mar 3, 2020
gio8tisu pushed a commit to gio8tisu/scikit-learn that referenced this pull request May 15, 2020
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.

Ensure that the shape of sample_weight is checked in all the functions
4 participants