NumPy allowed · plain Python earns 10 bonus points
Computed matrix × vector transformation
Implement the three classification metrics that matter far more than raw accuracy whenever classes are imbalanced -- the numbers behind every "high accuracy, useless model" cautionary tale in ML.
Implement precision_recall_f1(tp, fp, fn), returning a dict with keys 'precision', 'recall', and 'f1', computed from the standard formulas with explicit zero-division guards.
precision_recall_f1(tp: int, fp: int, fn: int) -> dict