All problems
Macro Recall
Problem
Compute macro-averaged recall over num_classes.
Class recall is the number of correct predictions for that class divided by the number of target pixels of that class; classes with no target pixels count as 0.0. Return the unweighted mean rounded to 4 decimal places.
Test cases
case 1
in: [[[0,1],[2,1]],[[0,1],[2,0]],3]
expected: 0.8333
case 2
in: [[[0,0]],[[1,1]],2]
expected: 0
case 3
in: [[[1,0]],[[1,1]],2]
expected: 0.25
Starter codePython
def macro_recall(pred, target, num_classes):
# Your code here
pass3 test cases · run your code against them in the editor