3 rules you could write on a napkin get within 1.3 points of the machine-learning model.
On 5,574 real text messages, scored on the same held-out split. Watch the three of them go up, including the one that does nothing at all and still scores 86%. That is the number that should worry you.
Here is the job. 5,574 real text messages, 747 of them spam. Sort them. Every machine below gets scored on the same messages it has never seen.
- Flag nothing86.01%
- Rules a person wrote97.31%
- A rule nobody wrote98.65%
Bars start at 80%, not zero. The whole argument on this job happens between 86% and 99%, and a bar drawn from zero hides it.
5,574 real text messages, 747 of them spam. Sort them. Every machine below is scored on the same held-out messages it has never seen.
SMS Spam Collection v.1, 5,574 messages. All three scored on the same held-out split, and the 8 candidate rules were written before any of them were tested. Nothing here is rounded in anyone’s favour.
What AI actually is
NextHow a model learns+Messages worth readingThe held-out half, and what each rule caught.
A filter is only as good as its hardest cases. These are real messages from the corpus. Obvious spams, ones that slip past almost every rule, ordinary messages that trip several, and ones that stay clean.
Spam
Free entry in 2 a wkly comp to win FA Cup final tkts 21st May 2005. Text FA to 87121 to receive entry question(std txt rate)T&C's apply 08452810075over18's
Spam
SIX chances to win CASH! From 100 to 20,000 pounds txt> CSH11 and send to 87575. Cost 150p/day, 6days, 16+ TsandCs apply Reply HL 4 info
Spam
URGENT! You have won a 1 week FREE membership in our £100,000 Prize Jackpot! Txt the word: CLAIM to No: 81010 T&C www.dbuk.net LCCLTD POBOX 4403LDNW1A7RW18
Spam
SMS. ac Sptv: The New Jersey Devils and the Detroit Red Wings play Ice Hockey. Correct or Incorrect? End? Reply END SPTV
Spam
Did you hear about the new "Divorce Barbie"? It comes with all of Ken's stuff!
Spam
BangBabes Ur order is on the way. U SHOULD receive a Service Msg 2 download UR content. If U do not, GoTo wap. bangb. tv on UR mobile internet/service menu
Ordinary
Turns out my friends are staying for the whole show and won't be back til ~ <#> , so feel free to go ahead and smoke that $ <#> worth
Ordinary
Today is ACCEPT DAY..U Accept me as? Brother Sister Lover Dear1 Best1 Clos1 Lvblefrnd Jstfrnd Cutefrnd Lifpartnr Belovd Swtheart Bstfrnd No rply means enemy
Ordinary
TODAY is Sorry day.! If ever i was angry with you, if ever i misbehaved or hurt you? plz plz JUST SLAP URSELF Bcoz, Its ur fault, I'm basically GOOD
Ordinary
Go until jurong point, crazy.. Available only in bugis n great world la e buffet... Cine there got amore wat...
Ordinary
U dun say so early hor... U c already then say...
Ordinary
Nah I don't think he goes to usf, he lives around here though
+What is actually going onHow did it find the pattern without being told?It counted. Which words turn up in which kind of message, and how often. Then it multiplied.
The model here is Multinomial naive Bayes, add-one smoothing, bag of words. For every word in the training set it counts how often that word appears in spam and how often in ordinary messages. A new message is scored by combining the counts for the words it contains.
That is genuinely all of it, and it is worth sitting with. There is no representation of what spam is anywhere in there. It has found that shortcodes and prize language cluster in one pile of examples. That is enough to be useful, and nowhere near enough to be trusted unsupervised.
Take it apart yourself: How a model learnsDescent · 8 min. Optional.
+What is actually going onWhy does a single accuracy number mislead?Because when one answer is much more common, guessing that answer every time already looks good.
747 of the 5,574 messages are spam, which is about one in seven. A filter that flags nothing is right about everything else, which is 86.0% of the time.
The two numbers that actually matter trade against each other: what got through, and what got wrongly flagged. The learned model missed 11 and wrongly flagged 4. Which of those two hurts more depends entirely on the job, and nobody can decide that for you from an accuracy figure.
+Watch somebody explain itWatch what a network learning from examples actually looks like inside.
Optional: watch someone explain it
But what is a neural network?
3Blue1Brown
Watch what a network learning from examples actually looks like inside.
+Go and try this on a real assistantFind the rule you would have written first.
Go and try this
Ask the two questions that make AI news readable
Next time you read a claim that an AI system achieves some percentage at something, ask two things before anything else. What was it shown to learn from? And what does the same score look like for the laziest possible answer?
Then look for the errors: what it missed, and what it wrongly flagged.
What to watch for: How often neither question is answered anywhere in the article. That absence is usually the story.
+Check yourselfIt marks itself, and nothing is sent anywhere.
A spam filter reports 86% accuracy. Should you be impressed?
Sources
- SMS Spam Collection v.1
Almeida, Gómez Hidalgo & Yamakami
All 5,574 real messages behind every figure on this page, and the held-out split both the rules and the model are scored on.
Free to use with attribution to the authors' 2011 paper
- Contributions to the Study of SMS Spam Filtering: New Collection and Results
Almeida, Gómez Hidalgo & Yamakami (ACM DOCENG 2011)
The paper describing how the corpus was collected, and published baselines for it.
- Some Studies in Machine Learning Using the Game of Checkers
Arthur Samuel, IBM Journal (1959)
The origin of the framing this lesson uses: programs that improve from experience rather than from instructions.
- But what is a neural network?
3Blue1Brown
What a network that learns from examples looks like from the inside, once the idea on this page is scaled up.