yhile-spam-lr-v1: A Lightweight Spam and Scam Text Classifier

yhile

  • spam
  • text-classification
  • logistic-regression

Abstract

We describe yhile-spam-lr-v1, a lightweight classifier that flags spam, phishing, and crypto-scam text. It combines TF-IDF features with logistic regression and is trained on three public corpora: the SMS Spam Collection, Enron-Spam, and the SpamAssassin public corpus. The model is small, fast, and inspectable, and is released openly with its weights and code.

Introduction

Spam and scam messages arrive by SMS, email, and chat, and their wording changes constantly. Large models can detect them, but a small linear model is cheap to run anywhere, easy to retrain, and can explain a prediction by pointing at the words that caused it. This report documents one such model, trained on public data so that anyone can reproduce or improve it.

Data

Training data combines three public corpora: the SMS Spam Collection [1], Enron-Spam [2], and the SpamAssassin public corpus [3]. Messages are merged into one dataset with a spam/scam label and a legitimate label, then split into training and test sets. The exact split sizes and preprocessing steps will be listed here with the final release.

Method

Text is converted to TF-IDF features and passed to a logistic regression classifier, both from scikit-learn [4] (Figure 1). Because the model is linear, each word has a weight that can be read directly, which makes errors easy to debug.

Results

Table 1 will report accuracy, precision, recall, and F1 on the held-out test set. The evaluation numbers are still being finalized, so the cells below read TBD.

Table 1. Test-set results (to be filled in).
ModelAccuracyPrecisionRecallF1
yhile-spam-lr-v1TBDTBDTBDTBD

Limitations

The training corpora are public and English, and some are more than a decade old, so the model can miss current scam wording and can flag legitimate promotional messages. A linear bag-of-words model also ignores word order and context. It is a baseline and a teaching example, not a complete spam-filtering system.

References

  1. Almeida, T. A., Gómez Hidalgo, J. M., and Yamakami, A. Contributions to the study of SMS spam filtering: new collection and results. Proceedings of the 11th ACM Symposium on Document Engineering, 2011.
  2. Metsis, V., Androutsopoulos, I., and Paliouras, G. Spam filtering with naive Bayes, which naive Bayes? Third Conference on Email and Anti-Spam (CEAS), 2006.
  3. The Apache SpamAssassin Project. SpamAssassin public corpus. spamassassin.apache.org/old/publiccorpus
  4. Pedregosa, F., et al. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.

Cite this

@misc{yhile2026spamlr,
  title        = {yhile-spam-lr-v1: A Lightweight Spam and Scam Text Classifier},
  author       = {yhile},
  year         = {2026},
  howpublished = {\url{https://ai.yhile.com/research/spam-lr-v1-report.html}},
  note         = {ai.yhile.com}
}