Classify text messages as spam or not spam.
Difficulty: Intermediate · Technology: Python, scikit-learn
Features to build
- Text preprocessing
- TF-IDF features
- Classifier training
- Precision and recall report
Step-by-step build plan
- Load a public labelled SMS dataset
- Clean text and vectorise it
- Train a classifier
- Measure precision and recall
- Try your own example messages
The part most people find hard
Handling imbalanced classes.
How to test it
Check false positives on genuine messages.
Suggested extensions
Add user accounts, better error handling, automated tests and a README with screenshots. Each extension is a new talking point in interviews.
How to describe it on your resume
Developed a text spam classifier with precision and recall evaluation.
Portfolio tip
Deploy it, link both the live version and the code, and write two paragraphs about what you learned and what you would improve.