Compute precision and recall of binary predictions. Labels and predictions are 0/1 arrays of equal length; the positive class is 1.
Implement solve(y,pred).
Returns. Return a tuple (precision, recall). Precision is 0.0 if nothing was predicted positive, and recall is 0.0 if there are no actual positives.
Example 1
Input:
solve([0, 1, 1, 0], [0, 1, 0, 1])
Output:
(0.5, 0.5)
Example 2
Input:
solve([1, 1, 0, 0], [0, 0, 0, 0])
Output:
(0.0, 0.0)
No results yet
Run your code to check it against the examples, or submit to run every test.