Skip to content
DeepForgeby svx
All problems
EasyML Fundamentalsml-178

Prediction Agreement Rate

Problem

Compute the fraction of samples where two prediction lists agree.

Empty input returns 0.0.

Hint

Agreement rate is the pairwise accuracy between two models.

Test cases

case 1
in: [[1,0,1],[1,1,1]]
expected: 0.6666666666666666
case 2
in: [[0,0],[0,0]]
expected: 1
case 3
in: [[1],[0]]
expected: 0
case 4
in: [[],[]]
expected: 0
Starter codePython
def agreement_rate(pred_a, pred_b):
    # Your code here
    pass

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