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

Skip to content

[MRG] Add sample_weight parameter to cohen_kappa_score (resubmitted from #7569) #8335

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 1 commit into from
Feb 10, 2017

Conversation

vpoughon
Copy link
Contributor

Reference Issue

Rebased, squashed and resubmitted from PR #7569 after reviews.

What does this implement/fix? Explain your changes.

This adds a sample_weight parameter to sklearn.metrics.cohen_kappa_score. The implementation simply forwards the argument to the underlying confusion_matrix call.

Any other comments?

It would be better to add a specific test in test_cohen_kappa() (here), but I don't know how to get reference kappa values for this test. Note that cohen_kappa_score is removed from METRICS_WITHOUT_SAMPLE_WEIGHT in test_common.py, which should provide additional testing, although not specific to this metric.

Finally I couldn't manage to run the full test suite locally so I'm relying on travis-ci here.

Copy link
Member

@TomDLT TomDLT left a comment

Choose a reason for hiding this comment

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

test_sample_weight_invariance() seems sufficient to me
LGTM, I merge since #7569 had already a +1.

Thanks @vpoughon

@TomDLT TomDLT merged commit dc6279c into scikit-learn:master Feb 10, 2017
@vpoughon vpoughon deleted the cohen_kappa_sample_weight branch February 10, 2017 13:34
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.

2 participants