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

PythonScikit-learnNLPKaggle

What happened?

  1. 01

    The question

    Can a legitimate message be told apart from spam using only its content — and with reliable metrics?

  2. 02

    The problem

    Raw text is messy: words, duplicates, noise. And a good model without honest evaluation is an illusion.

  3. 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.

  4. 04

    The build

    Complete classification pipeline: preprocessing, feature engineering, model comparison with clear and reproducible metrics.

  5. 05

    The failure

    The first metrics looked perfect — until I noticed a poorly handled class imbalance that was artificially inflating accuracy.

  6. 06

    The discovery

    Accuracy alone lies. Precision, recall, F1 and a confusion matrix tell the real story of a classification problem.

  7. 07

    The result

    A reproducible pipeline with detailed metrics available, ready to be retrained on other datasets.

  8. 08

    The next frontier

    Moving to richer representations (embeddings) and testing approaches more robust to noise.

Spider-Verse · homage