Can a spreadsheet figure out the pattern on its own?
Lesson 4.4 · The Spreadsheet That Learns
Felix
Type two examples. It guesses the other eighteen.
Felix’s product names are a mess: “NIKE dunk low panda sz10,” “Adidas Samba OG (9.5),” “nb 990v6 grey.”
He needs a clean Brand column and doesn’t want to type twenty brands. He types two. The spreadsheet fills in the rest.
The short answer
Learning from examples: Flash Fill doesn’t have a rule for brands. It looks at your examples, guesses the pattern that would produce them, and applies it. That’s the core move of machine learning: examples in, pattern out, mistakes on the cases the examples didn’t cover.
Try it yourself
Step through what happens when Felix types two examples and lets the sheet guess the rest.
| Product name | Brand |
|---|---|
| NIKE dunk low panda sz10 | |
| Adidas Samba OG (9.5) | |
| nb 990v6 grey | |
| Vans old skool blk | |
| Nike AF1 white 10.5 |
The messy names. Felix wants just the brand in the next column.
What you just did has a name
Learning from examples
Flash Fill doesn’t have a rule for brands.
It looks at your examples, guesses the pattern that would produce them, and applies it.
That’s the core move of machine learning: examples in, pattern out, mistakes on the cases the examples didn’t cover.
A few more things
No rule was written
Nobody told the sheet “brand is the first word.” It figured that out from two rows. Give it different examples and it would guess a different pattern.
The mistake is the lesson
“nb” wasn’t in the examples, so the pattern did something dumb with it. Every learning system fails this exact way: fine on things like the examples, weird on things unlike them. Module 18 is about that.
Go deeper
The longer version, if you want it.
How Flash Fill actually works
Under the hood it searches a set of small text-transforming programs (take the first word, capitalize it, drop numbers) for one that turns every example input into its example output. That’s called program synthesis, and it’s closer to a puzzle solver than to the neural networks in Module 20.
It still counts as learning from examples, and it shares the key weakness: the more examples you give, the fewer wrong guesses it makes. Two examples got “nb” wrong. Three, including a New Balance, would have gotten it right.
Quick check
You show a sheet two examples: “jsmith@school.org” becomes “J. Smith” and “akhan@school.org” becomes “A. Khan.” Then it turns “mary.lee@school.org” into “M. Ary.lee.” What went wrong?
Let’s take it slower
Try it this way: the sheet is playing a guessing game. You hand it a few before-and-after pairs, and it hunts for the simplest rule that turns every before into its after. Then it runs that rule on everything else, confidently. It has no idea what a brand or a name is. It only knows the pairs you showed it. So it does fine on anything that looks like your pairs and does something odd on anything that doesn’t. More pairs, fewer odd results.
More examples
Autocorrect learning your slang
Type a made-up word a few times, tap “keep” each time, and your keyboard stops fighting you. You never entered a rule. You gave it examples, and it learned that the word is yours. Then it happily suggests it in an email to a teacher.
The photo app’s dog album
Tag your dog in five photos and the app builds an album of her. It learned from the five. Then it adds the neighbor’s dog, who looks alike, because nothing in the five examples said “only this one.”
Back to the question
So can a spreadsheet figure out a pattern on its own?
Show the answer
Mostly. It guessed the brand right for four of five, and needed Felix for the one the examples didn’t cover. That ratio, mostly right and wrong in a predictable way, is machine learning in miniature.
One last question
Why did Flash Fill write “Nb” instead of “New Balance”?
Talk Card
Talk Card · 4.4
Type two examples and the spreadsheet works out the pattern for the rest. That’s learning from examples, and it gets the cases the examples didn’t cover wrong.
Data to AI · pettigrewlab.com/learn
