Salesforce-inspired model evaluation dashboard receives predicted and true binary labels from a validation run. You need to compute the confusion-matrix counts so the team can derive the metrics shown to model owners.
Compare the true labels y with the predicted labels p (both 0/1) and count the four outcomes. The tuple order is (TP, TN, FP, FN).
Implement solve(y,p).
Returns. Return a tuple of four Python integers (tp, tn, fp, fn).
Example 1
Input:
solve([1, 0, 1, 0], [1, 0, 0, 1])
Output:
(1, 1, 1, 1)
Example 2
Input:
solve([1, 1, 1, 0], [1, 1, 0, 0])
Output:
(2, 1, 0, 1)
No results yet
Run your code to check it against the examples, or submit to run every test.