Module 16 · Sorting Into Categories

Scam or not?

Lesson 16.1 · Yes or No

Rosa

Twelve texts. Two buckets. Which clue tips each one?

Rosa’s phone sorted the package text into Junk.

It also sorted Owen’s “running late” into her inbox. She wants to know what it saw.

So she looks at twelve texts and tries to sort them herself, noticing which clue tips each one.

Try it yourself

Swipe each text into Scam or Safe. After each one, see which clues a model would have weighed.

1 of 6

“Your package is on hold. Confirm your address here: bit.ly/pkg-hold-22”

Put it in

What you just did has a name

Classification

Classification is predicting a category instead of a number.

Scam or safe, cat or not cat, hit or miss.

A classifier learns from examples that already have the right category, then sorts new cases by weighing their clues.

It’s supervised learning where the label is a bucket.

A few more things

Regression predicts a number, classification a bucket

Module 15 predicted a price. This module predicts a category. Same idea, examples in and a pattern out. Different kind of answer.

Clues get weights

A link pushes toward scam a little. Urgency pushes more. An unknown sender pushes more still. A known sender pushes hard the other way. The model learned those pushes from thousands of labeled texts.

It has to be wrong sometimes

The group project text had a link. The “is this Jordan” text had none. A classifier that never misses doesn’t exist, and lesson 16.3 is about deciding which misses you can live with.

Go deeper

The longer version, if you want it.

Logistic regression

The simplest classifier is Module 15’s line with a squash on the end. Each clue gets a weight, the weighted clues are added up, and the total is pushed through a curve that turns any number into a probability between 0 and 1. Above 0.5, call it scam. It’s called logistic regression, which is confusing, because it classifies.

The weights are learned the same way as the regression line: nudge them until the model’s probabilities match the labels on the training texts as well as possible. Everything from the cars lesson carries over, including the danger of extrapolating.

Quick check

A hospital has two models. One looks at an X-ray and says fracture or no fracture. The other guesses how many days the patient will stay. Which one is the classifier?

Let’s take it slower

Try asking what shape the answer has. If the answer is a number on a scale, dollars, minutes, views, that’s regression. If the answer is one of a fixed set of choices, yes or no, this pile or that pile, that’s classification. The training is the same recipe: show the model old cases where the choice is already known, and let it work out which clues lean which way. Then a new case shows up, the clues get weighed, and the heavier side wins. A vote among clues, with weights it learned.

More examples

1

Approve or decline

A card company decides in a blink whether a purchase is yours or a thief’s. Clues: the store, the time, how far it is from your last purchase. The answer is a bucket, approve or decline, learned from millions of past purchases that turned out one way or the other.

2

The recycling belt camera

Some sorting plants point a camera at the conveyor and a model calls each item plastic, paper, metal or trash. It learned from photos that workers had already labeled. Four buckets instead of two, same idea.

Back to the question

So, scam or not?

Show the answer

Scam. Link, urgency, stranger. Rosa’s phone weighed the same three clues and reached the same bucket, only faster. The “is this Jordan” text is the one worth remembering: no link, no rush, and still a scam. Clues are weights, not rules.

One last question

How does a scam filter decide?

Talk Card

Talk Card · 16.1

A classifier weighs clues like links, urgency and unknown senders, learned from examples, and picks a bucket. No single clue decides.

Data to AI · pettigrewlab.com/learn

Next lesson