Skip to main content

Spam Mail Classification Using Ensemble and Non-Ensemble Machine Learning Algorithms

  • Conference paper
  • First Online:
Machine Learning for Predictive Analysis

Part of the book series: Lecture Notes in Networks and Systems ((LNNS,volume 141))

Abstract

Spam in emails has been a prevalent issue ever since the inception of the email service. However, the use of ensemble (aggregate) and non-ensemble algorithms for the detection and filtering of spam has been less explored. In this paper, we develop certain ensemble and non-ensemble machine learning (ML) algorithms for classifying emails as spam or ham (i.e., not spam). Using the Enron-SMS dataset from the UCI ML repository and an 80 and 20% training and test split, we develop and calibrate non-ensemble ML algorithms like KNN, Naïve Bayes, and Support Vector Machine. Also, we develop and calibrate ensemble ML algorithms containing the non-ensemble algorithms via voting, bagging, and boosting methods. Results reveal that the non-ensemble Support Vector Machine performed the best with 98.47% accuracy on test data and it was followed by the ensemble voting algorithm with 96.80% accuracy on test data. We highlight the implications of using non-ensemble and ensemble methods for spam classification in the real world.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 259.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 329.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 329.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. B. Dada et al, Machine learning for email spam filtering: review, approaches and open research problems. Heliyon 5(6) (2019)

    Google Scholar 

  2. W.A. Awad, S.M. ELseuofi, Machine learning methods for spam E-Mail classification. Int. J. Comput. Sci. Inform. Technol. 3 (2011). 10.5121/ijcsit.2011.3112

    Google Scholar 

  3. A. Harisinghaney, A. Dixit, S. Gupta, A. Arora, Text and image-based spam email classification using KNN, Naïve Bayes and Reverse DBSCAN algorithm, in 2014 International Conference on Reliability Optimization and Information Technology (ICROIT), Faridabad, pp. 153–155 (2014)

    Google Scholar 

  4. W. Feng, J. Sun, L. Zhang, C. Cao, Q. Yang, A support vector machine based naive Bayes algorithm for spam filtering, in 2016 IEEE 35th International Performance Computing and Communications Conference (IPCCC), Las Vegas, NV, pp. 1–8 (2016)

    Google Scholar 

  5. Y. Chen, C. Lu, C. Huang, Anti-spam filter based on Naïve Bayes, SVM, and KNN model (2009)

    Google Scholar 

  6. Z. Yang, X. Nie, W. Xu, J. Guo, An approach to spam detection by Naive Bayes ensemble based on decision induction, in International Conference on Intelligent Systems Design and Applications, vol. 2, pp. 861–866. https://doi.org/10.1109/isda.2006.253725

  7. J. Carpinter, Evaluating ensemble classifiers for spam filtering (2005)

    Google Scholar 

  8. S. Trivedi, S. Dey, Interplay between probabilistic classifiers and boosting algorithms for detecting complex unsolicited emails. J. Adv. Comput. Netw. 132–136 (2013). https://doi.org/10.7763/jacn.2013.v1.27

  9. M.F. Saeedian, H. Beigy, Spam detection using dynamic weighted voting based on clustering, in 2008 Second International Symposium on Intelligent Information Technology Application, Shanghai, pp. 122–126 (2008)

    Google Scholar 

  10. C.W. Geng, Q. Li, L. Xu, X. Jin, Boosting the performance of web spam detection with ensemble under-sampling classification, in Fourth International Conference on Fuzzy Systems and Knowledge Discovery (FSKD 2007), Haikou, pp. 583–587 (2007)

    Google Scholar 

  11. T.A. Almeida, J.M.G. Hidalgo, A. Yamakami, Contributions to the study of SMS spam filtering: new collection and results, in Proceedings of the 2011 ACM Symposium on Document Engineering (DOCENG’11), Mountain View, CA, USA (2011). https://archive.ics.uci.edu/ml/datasets/SMS+Spam+Collection. http://www.dt.fee.unicamp.br/~tiago/smsspamcollection/

  12. NLTK library for Python. https://www.nltk.org/

  13. CountVectorizer. https://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.text.CountVectorizer.html

  14. TfidfTransformer. https://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.text.TfidfTransformer.html

  15. C.M. Bishop, Pattern recognition and machine learning (Springer, 2006)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Prakhar Uniyal .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Agarwal, K., Uniyal, P., Virendrasingh, S., Krishna, S., Dutt, V. (2021). Spam Mail Classification Using Ensemble and Non-Ensemble Machine Learning Algorithms. In: Joshi, A., Khosravy, M., Gupta, N. (eds) Machine Learning for Predictive Analysis. Lecture Notes in Networks and Systems, vol 141. Springer, Singapore. https://doi.org/10.1007/978-981-15-7106-0_18

Download citation

Publish with us

Policies and ethics