5,572 messages.
One in seven is spam.
An existing labelled corpus assembled from several sources, including legitimate messages from the NUS SMS Corpus and spam reported to the UK Grumbletext forum. The raw label is v1 (ham or spam); the text is v2.
- Ham
- 4,825
- 86.59%
- Spam
- 747
- 13.41%
- RawRaw CSV rows
SMS Spam Collection file supplied to the group
- CleaningAfter exact duplicates
403 identical (label, text) copies removed
- CleanedUsable, uniquely worded
43 more removed: empty, conflicting or repeated after normalisation
Stratified split, random_state = 42. Zero identical cleaned messages are shared between training and test.
Spam talks
for longer.
The median spam SMS is 149 characters, compared with 52 for ham. Length is a useful description, but a long message alone is not evidence of spam, and the models do not use it.
| Measure | Ham | Spam |
|---|---|---|
| Messages | 4,825 | 747 |
| Share | 86.59% | 13.41% |
| Median chars | 52 | 149 |
| Middle 50% | 33–92 | 132.5–157 |
| Median words | 11 | 25 |
| Mean chars | 71 | 138.9 |
Exact duplicates in raw CSV: 403.
Words that tip
the balance.
Terms with the largest gap between the fitted Naive Bayes model's spam and ham likelihoods (log-likelihood ratio). These are associations in this historical corpus; no single word determines a label.
- gt-4.82
- lt-4.81
- lor-4.65
- da-4.58
- later-4.22
- doing-4.12
- work-4.05
- lol-4.05
- ask-4.01
- happy-3.96
- claim+6.46
- prize+6.39
- www+6.20
- 150p+5.96
- guaranteed+5.77
- 18+5.73
- 16+5.66
- 1000+5.66
- ringtone+5.64
- cs+5.61
- ham
What r u cooking me for dinner?
- ham
So dont use hook up any how
- ham
Dont you have message offer
- ham
Yesterday its with me only . Now am going home.
- spam
Bought one ringtone and now getting texts costing 3 pound offering more tones etc
- spam
RGENT! This is the 2nd attempt to contact U!U have WON å£1250 CALL 09••••••••• b4 05•••• T&CsBCM4235WC1N3XX. callcost 150ppm mobilesvary. maxå£7. 50
- spam
goldviking (29/M) is inviting you to be his friend. Reply YES-762 or NO-762 See him: www.SMS.ac/u/goldviking STOP? Send STOP FRND to 62•••
- spam
Welcome to Select, an O2 service with added benefits. You can now call our specially trained advisors FREE from your mobile by dialling 402.
Shown with their dataset labels. Long numbers are partially masked (••).