11
Spam Detection
Complete message classification pipeline (spam vs ham): NLP preprocessing, feature engineering, and model comparison between Random Forest and Logistic Regression with clear metrics.
Detailed metrics available
Stack
What happened?
- 01
The question
Can a legitimate message be told apart from spam using only its content — and with reliable metrics?
- 02
The problem
Raw text is messy: words, duplicates, noise. And a good model without honest evaluation is an illusion.
- 03
The hypothesis
A clean NLP pipeline (preprocessing + features) followed by an honest Random Forest vs Logistic Regression comparison will give a reliable, measurable classifier.
- 04
The build
Complete classification pipeline: preprocessing, feature engineering, model comparison with clear and reproducible metrics.
- 05
The failure
The first metrics looked perfect — until I noticed a poorly handled class imbalance that was artificially inflating accuracy.
- 06
The discovery
Accuracy alone lies. Precision, recall, F1 and a confusion matrix tell the real story of a classification problem.
- 07
The result
A reproducible pipeline with detailed metrics available, ready to be retrained on other datasets.
- 08
The next frontier
Moving to richer representations (embeddings) and testing approaches more robust to noise.
