# Are there any advantages of using rules-based approaches versus models for detecting spam?

Suppose that we have unlabeled data. That is, all we have are a collection of emails and want to determine whether any of them is spam or not. Let's say we have $$1,000$$ rules to determine whether a particular email is spam or not. For example, one rule could be that a sender's email address should not contain the text  no_reply . If an email does contain this text, then it would be classified as spam.

Question. What are the advantages/disadvantages of a rules-based approach for detecting spam vs. a non-rules-based approach/unsupervised methods for detecting spam?

Would there even be a point in constructing a non-rules based model given that we already have a rules based model? Could we use the rules-based model to create some labeled training data and then apply supervised techniques?

• This. But you should also take into account that your rules and therefore your training data have incorrect classifications. For example, no_reply as a localpart is relatively common for automatically generated mails which are not spam at all but requested by the recipient. My experience (I've built a deep learning spam classifier) is that with a very basic feature set reasonable results can be achieved (after training on manually classified samples) but for production quality you need several iterations of looking at the results (especially misclassifications) and adjusting feature extracti – Hans-Martin Mosner Mar 22 '19 at 18:08