Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 03 · AI · Past the basics · about 17 min to read

Watch: What AGI means, and who gets to say
▶ VideoPlay it as a journeyTutor comes with a plan

Precision and Recall (where to set the spam filter’s bar)

How Do You Know It's Good
How Do You Know It's Good · Open board

How Do You Know It’s Good?, on the How LLMs Work track. The board splits every task by how checkable it is, and puts “spam or not spam” firmly on the checkable side: every email has one right answer, so a filter can be graded exactly. This lesson is that exact grading, done by hand, on the oldest machine-learning job most people have met: the spam folder.

Before you start. You need What a Neural Network Is and Vectors, Dot Products and Matrix Multiply. The first showed that one neuron is a weighted sum: each input times its weight, added up, plus a starting value. The second showed that a weighted sum is a dot product, one row of numbers times another. This lesson is that one neuron, used to answer a yes-or-no question, and then the arithmetic of how to tell whether its answers are any good. It feeds Evaluating Models (how do you *know* it's good?) and Evals for Apps (the test suite for a program that is a string), which grade bigger models with the same habits.

Lesson 23 of 83 in AI

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • August 2002: six months of spam rules, and every fix cost a real email
  • A weighted sum, then a squashing curve: turning evidence into a probability
  • The threshold: the line where a probability becomes “move it to spam”
  • Precision and recall: two questions about the spam folder
  • Lowering the threshold: recall rises, precision falls
  • How rare the spam is: the same filter, a cleaner inbox, a worse spam folder
  • The squash, by hand
  • The filter finds its own weights
  • The four boxes, counted
  • All of it in code

Terms it explains: How LLMs Work, false positive, 1.0, −2.5, sigmoid, threshold, left in the inbox, precision, recall, logistic regression, confusion matrix, base rate.

Lab

The filter has scored every email. How sure must it be before one goes to the spam folder?

Drag How sure before it goes to the spam folder from 0.90 down to 0.20 and watch false alarms per 1,000 good emails climb.

Open The decision threshold

Related papers

Review AI