All problems
Subset Accuracy
Problem
Compute subset accuracy for multi-label predictions.
Return the fraction of samples whose entire prediction vector equals the target vector, rounded to 4 decimal places.
Test cases
case 1
in: [[[1,0],[1,1]],[[1,0],[0,1]]]
expected: 0.5
case 2
in: [[[1,1],[0,0]],[[1,1],[0,0]]]
expected: 1
case 3
in: [[[1,0]],[[0,1]]]
expected: 0
Starter codePython
def subset_accuracy(pred, target):
# Your code here
pass3 test cases · run your code against them in the editor