LessonΒ·difficulty 2/5Β·~15 min
Count classifier outcomes
Implement confusion_counts(actual, predicted).
actual and predicted are equal-length lists containing only 0 and 1. Class 1 is positive. Return counts under keys tp, fp, tn, fn, including zero counts. Empty lists return all zeros.
Before coding, predict one result by hand. After the tests pass, explain your approach and add a boundary example of your own.
Tests
- Case 1
- Case 2
- Case 3
β¦ Stuck? Ask for a spark
Sign in or create a free account to use your monthly AI explainer allowance.
warming up
Loading editorβ¦
Consolewaiting
$ Console output will appear here.