Build the 2×2 confusion matrix of binary labels and predictions. Rows are the actual class and columns are the predicted class.
Implement solve(y,pred).
Returns. Return a 2×2 integer array [[TN, FP], [FN, TP]].
Example 1
Input:
solve([0, 1, 1, 0], [0, 1, 0, 1])
Output:
[[1, 1], [1, 1]]
Example 2
Input:
solve([1, 1, 1, 0], [1, 1, 0, 0])
Output:
[[1, 0], [1, 2]]
No results yet
Run your code to check it against the examples, or submit to run every test.