FunctionRacerProblemsRace

Table of Hits and Misses

Easyscikit-learnPython

truth holds real labels and guess predicted ones, both from 0 to k - 1, and every label appears in truth. Return the confusion matrix: a k by k table in which the entry in row i, column j counts the cases whose real label is i and whose predicted label is j.

Example 1

truth [0,0,1,1,1]
guess [0,1,1,1,0]
returns [[1,1],[1,2]]

Of the two real 0s, one was called 0 and one 1. Of the three real 1s, one was called 0 and two 1.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More scikit-learn problems