Before any per-class metric there is a confusion matrix, and building one with two nested loops over classes is the answer that gets you asked to try again.
Implement confusion_matrix(y_true, y_pred, n_classes). Given two integer arrays of the same length whose values are class indices in [0, n_classes), return an (n_classes, n_classes) integer array where entry [i, j] is the number of samples whose true class is i and whose predicted class is j.
y_true = [0, 1, 1, 2]
y_pred = [0, 1, 2, 2]
pred 0 pred 1 pred 2
true 0 1 0 0
true 1 0 1 1
true 2 0 0 1
Rows are true classes and columns are predictions. A class that appears in neither array still gets its own row and column of zeros: the matrix is always (n_classes, n_classes).
Do it in one pass with no Python loops. The trick is that a pair of small integers is itself a single integer.
Build the architecture on a canvas: place the components, configure them, connect them into a data flow, and write a short reason for each one. The AI reviewer grades your design against a rubric written specifically for this problem.
Minimum 5 components · needs a wide desktop screen