Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MRG+1] TST: added test for estimators supporting list of weights #8261

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
merged 5 commits into from
Feb 3, 2017

Conversation

dalmia
Copy link
Contributor

@dalmia dalmia commented Feb 1, 2017

Reference Issue

Fixes #8064

What does this implement/fix? Explain your changes.

This adds a common test for all estimators showing that they support a list of weights as the value for the sample_weight argument to fit.

Any other comments?

Since the estimators didn't throw any error, I assume that they support it. So, I have just implemented something to get the PR going. Please provide feedback as to whether my approach is the correct one.

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.

If it works, why is it WIP?

Ideally we'd like to check the model is identical invariant of list vs array. However, we don't have an easy way to check models are identical. Maybe leave a comment.

Otherwise LGTM

@jnothman
Copy link
Member

jnothman commented Feb 2, 2017

Sorry. I somehow ignored the fact that tests are failing.

@jnothman
Copy link
Member

jnothman commented Feb 2, 2017

Yup. LogisticRegressionCV is failing, having assumed sample_weight would be an array. Fix it!

@dalmia
Copy link
Contributor Author

dalmia commented Feb 3, 2017

@jnothman Yes, working on it.

@jnothman
Copy link
Member

jnothman commented Feb 3, 2017

A list is array-like. We want to support it.

@dalmia
Copy link
Contributor Author

dalmia commented Feb 3, 2017

Oh. Sorry, I had misunderstood the meaning. I'll fix it.

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.

check_array and check_consistent_length might be appropriate.

@GaelVaroquaux GaelVaroquaux changed the title [WIP] TST: added test for estimators supporting list of weights [MRG+1] TST: added test for estimators supporting list of weights Feb 3, 2017
@GaelVaroquaux
Copy link
Member

This looks good & tests are passing.

+1 for merge from my side. Thanks!

@jnothman
Copy link
Member

jnothman commented Feb 3, 2017

LGTM! Thanks!

@jnothman jnothman merged commit c5bcdde into scikit-learn:master Feb 3, 2017
@dalmia dalmia deleted the 8064 branch February 3, 2017 08:09
sergeyf pushed a commit to sergeyf/scikit-learn that referenced this pull request Feb 28, 2017
@Przemo10 Przemo10 mentioned this pull request Mar 17, 2017
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
NelleV pushed a commit to NelleV/scikit-learn that referenced this pull request Aug 11, 2017
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
lemonlaug pushed a commit to lemonlaug/scikit-learn that referenced this pull request Jan 6, 2021
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.

Common test for sample_weight as list
3 participants