Skip to content
DeepForgeby svx
All problems
EasyStatisticsst-416

Cohen Kappa Expected Agreement

Problem

From two raters with positive rates p1 and p2 on a binary label, chance agreement is p_e = p1 p2 + (1 - p1)(1 - p2).

Given the two positive rates, return the expected agreement.

Hint

Both agreeing positive and agreeing negative contribute.

Test cases

case 1
in: [0.5,0.5]
expected: 0.5
case 2
in: [0.8,0.6]
expected: 0.5599999999999999
case 3
in: [1,0]
expected: 0
Starter codePython
def cohen_kappa_expected_agreement(p1, p2):
    # Your code here
    pass

3 test cases · run your code against them in the editor