maaz.code logo
Simple view

Complete

Automated Email Classification Engine

SVM spam/ham classifier with custom parsing and zero train/test leakage.

  • Macro F10.97
  • Accuracy97%
  • Python
  • Scikit-Learn
  • SVM
  • NLP

What it does

Classifies emails as spam or ham with a Support Vector Machine.

  • Custom email parsing and cleaning.
  • Vocabulary building and count vectorization.
  • Linear SVM classifier: 0.97 macro F1 and 97% accuracy, with no train/test leakage.

Workflow

Workflow: the raw emails (easy ham, hard ham, spam) are split 80/20 into train and test sets; each email is read, parsed and counted against a dictionary of every unique word; the processed train matrix trains a linear SVM and the test matrix evaluates it.

Solid lines are the training emails; dashed lines are the test emails, which go through the same steps but are only used to evaluate the trained SVM. Tap or click the diagram to open it at full size.