Classification metrics from counts

Problem

A classifier has TP=30\mathrm{TP}=30, FP=10\mathrm{FP}=10, FN=20\mathrm{FN}=20, and TN=40\mathrm{TN}=40. Compute accuracy, precision, recall, and F1F_1.

Reveal answer or reference solution

Accuracy is 0.700.70, precision is 0.750.75, recall is 0.600.60, and

F1=2(0.75)(0.60)0.75+0.60=23.F_1=\frac{2(0.75)(0.60)}{0.75+0.60}=\frac{2}{3}.

Local history

Loading attempts saved in this browser…

Use with your agent

Share this URL and your attempt. Ask the agent to start with a clarifying question or the smallest useful hint.

Tutor me on https://mlprep.iwase.dev/machine-learning/classification/original-ml-metrics/. If window.mlPrepAgent is available, read attempts for item original-ml-metrics before tutoring. Inspect my attempt, keep the item ID, and do not reveal the full answer first. After a real attempt, append its record and read it back.

Appears in