0Pricing
Deep Learning Academy · Lesson

Precision, Recall, F1 & ROC-AUC

Beyond accuracy for real evaluation.

Precision, Recall, F1 & ROC-AUC is a free Deep Learning Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Deep Learning Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Accuracy Can Lie

When one class dominates, accuracy looks great even for a useless model. You need sharper metrics to judge real performance.

The Four Outcomes

Every prediction is a true positive, true negative, false positive, or false negative. These four counts power every richer metric.

Precision: Trust the Positives

Precision asks: of everything you flagged positive, how many truly were? High precision means few false alarms.

precision = tp / (tp + fp)

Recall: Catch Them All

Recall asks: of all the real positives, how many did you catch? High recall means few missed cases.

recall = tp / (tp + fn)

The Tradeoff

Push precision up and recall often drops, and the reverse. The right balance depends on the cost of each kind of mistake.

F1: One Balanced Score

The F1 score is the harmonic mean of precision and recall. It rewards models that keep both reasonably high.

f1 = 2 * p * r / (p + r)

Thresholds Move the Line

A classifier outputs a probability; the threshold decides positive versus negative. Sliding it reshapes precision and recall.

The ROC Curve

The ROC curve plots true positive rate against false positive rate across every threshold, showing the full tradeoff at a glance.

ROC-AUC in One Number

ROC-AUC is the area under that curve. It captures ranking quality with one threshold-free number from zero to one.

from sklearn.metrics import roc_auc_score

Reading AUC Values

An AUC of 0.5 is random guessing, while 1.0 is perfect separation. Higher means the model ranks positives above negatives well.

Pick the Metric That Fits

Choose your metric by the task: recall for disease screening, precision for spam filters, AUC for ranking quality.

Quick Check

Think about which metric counts how many real positives you successfully caught.

Recap

Go beyond accuracy with precision, recall, F1, and ROC-AUC. Each answers a different question, so match the metric to your goal. 🎯

Frequently asked questions

Is the “Precision, Recall, F1 & ROC-AUC” lesson free?

Yes — the full text of “Precision, Recall, F1 & ROC-AUC” is free to read here on the web, and the Deep Learning Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Deep Learning Academy course, upgrade to CoddyKit PRO.

What will I learn in “Precision, Recall, F1 & ROC-AUC”?

Beyond accuracy for real evaluation. You practise Deep Learning Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Deep Learning Academy?

No prior experience is required. Deep Learning Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Precision, Recall, F1 & ROC-AUC” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Deep Learning Academy lesson?

Yes. Every Deep Learning Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Precision, Recall, F1 & ROC-AUC
  2. Confusion Matrices & Error Analysis
  3. Grad-CAM: See What the Model Looks At
  4. Calibrate Confidence
← Back to Deep Learning Academy