Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[MRG] Add sample_weight parameter to cohen_kappa_score (resubmitted from #7569) #8335
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.