A COMPARATIVE ANALYSIS OF MACHINE LEARNING ALGORITHMS FOR SPAM EMAIL DETECTION: PERFORMANCE EVALUATION AND ACCURACY ASSESSMENT

Authors

  • Abdul Wahab Khan
  • Muhammad Fawad Nasim

Keywords:

spam detection; machine learning; text classification; Naive Bayes; support vector machine; ensemble learning; TF-IDF; performance evaluation

Abstract

Email remains one of the primary vectors for unsolicited, fraudulent, and malicious content, commonly referred to as spam. This paper presents a systematic comparative evaluation of eight supervised machine learning algorithms Naive Bayes, Logistic Regression, Support Vector Machines, Decision Tree, Random Forest, k-Nearest Neighbours, Gradient Boosting, and a Multi-Layer Perceptron neural network for the task of binary spam email classification. Using a stratified benchmark corpus of 8,000 labelled messages drawn from the Enron-Spam, SpamAssassin, and Ling-Spam collections, each model is trained on TF-IDF weighted lexical features and assessed using accuracy, precision, recall, F1-score, and area under the ROC curve (AUC). Experimental results indicate that ensemble methods, particularly Gradient Boosting (98.9% accuracy, F1 = 0.986) and Random Forest (98.6% accuracy, F1 = 0.982), outperform single-model classifiers, while Naive Bayes offers the most favourable accuracy-to-computation trade-off. The paper further discusses computational cost, interpretability, and practical deployment considerations, concluding with recommendations for real-time spam-filtering pipelines.

Downloads

Published

2026-03-31