Skip to content

Introduction

Emails are an essential part of everyday life. They are used for communication between people both in private life and for business purposes. Generally, emails can be categorized as spam or non-spam, where non-spam emails contain useful or desired information for the recipient. Spam emails, on the other hand, are unwanted by the recipient and can be sent with the purpose of advertising, fraud, etc. According to the Trustwave Global Security Report 2020, 45% of all emails sent in 2018 were spam. Nowadays, email service providers use spam filters based on various machine learning methods to distinguish between spam and non-spam emails.

In the following report, we will take the rather unusual perspective of a scammer. Since spam filters are continuously improving, it is not easy to write spam mail that still passes those advanced filters. We will therefore analyze the predicted spam probability for various emails and try to find rules how spam filters can be fooled, so spam will still pass spam filters.

The goal of this report is to describe and compare predictive modeling approaches for spam filtering based on a dataset where information about the content of emails and their classification as "spam" or "non-spam" has been collected. By applying interpretable machine learning methods, the inner workings of spam filters will be analyzed to bring more transparency to so-called black-box algorithms. Models and visualizations are implemented in R and Python using the packages "mlr3", "ggplot", "iml", "DALEX", "scikitlearn" and "matplotlib".

Back to top