Skip to content
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

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

Merged
merged 1 commit into from Feb 10, 2017

Conversation

@vpoughon
Copy link
Contributor

@vpoughon vpoughon commented Feb 10, 2017

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.

@TomDLT
TomDLT approved these changes Feb 10, 2017
Copy link
Member

@TomDLT TomDLT left a comment

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
5 checks passed
5 checks passed
ci/circleci Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 94.74%)
Details
codecov/project 94.74% (+0%) compared to eee8be4
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@vpoughon vpoughon deleted the vpoughon:cohen_kappa_sample_weight branch Feb 10, 2017
sergeyf added a commit to sergeyf/scikit-learn that referenced this pull request Feb 28, 2017
@Przemo10 Przemo10 mentioned this pull request Mar 17, 2017
Sundrique added a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
NelleV added a commit to NelleV/scikit-learn that referenced this pull request Aug 11, 2017
paulha added a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
maskani-moh added a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.