Historical machine learning project (2019) — a desktop spam/ham email classifier using bag-of-words features and multinomial Naive Bayes.
This is an archived-in-practice learning project, not an actively maintained spam-filter product. The original code relies on older Python and pandas conventions. The repository is kept as evidence of early ML experimentation, not as a production-ready or benchmarked classifier.
- Dataset loading: reads message bodies from local
hams/andspams/directories. Separatehams_t/andspams_t/directories are used for test examples. - Feature engineering:
sklearn.feature_extraction.text.CountVectorizerturns email text into a bag-of-words feature matrix. - Classification:
sklearn.naive_bayes.MultinomialNBtrains on the labelled spam/ham examples. - Evaluation: the original script computes true positives, true negatives, false positives and false negatives, displays a confusion matrix and simple classification statistics.
- User interface:
app_final.pyprovides a Tkinter-based desktop form.
spam / ham messages
│
▼
CountVectorizer
│
▼
MultinomialNB
│
▼
spam / ham label
- Some code uses Python 2 syntax, including
Tkinterand iterator conventions. - Deprecated pandas methods such as
DataFrame.appendare present. - Some GUI/evaluation routines need fixes before a current Python 3 run.
- There are no independently validated precision/recall numbers claimed in this README.
For the current applied-ML direction, see the Production ML Pipeline roadmap covering leakage checks, measured evaluation, calibration, serving and drift.
Author's portfolio: Omar Laraqui · Selected work