[MRG] Add sample_weight parameter to cohen_kappa_score (resubmitted from #7569)#8335
Merged
Merged
Conversation
sergeyf
pushed a commit
to sergeyf/scikit-learn
that referenced
this pull request
Feb 28, 2017
Closed
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.