I want to train a binary classification algorithm for spam detection using labeled data set. The dataset has the following features:

Email address, text message (split into subject and corpus), date

An example of data is:

Email | Subject | Corpus | Date 
[email protected] | Example | this is just an example of my dataset  | 2020/08/20

What I would like is to transform data features in real numbers and binarize email addresses. As algorithm I was thinking of SVM and/or Naïve Bayes.

My difficulties are, however, in how transform data features in real numbers in order to get more parameters in my classifier.

I am using Python.

Could you please give me an example of how to do it?


1 Answer 1


The term you are looking for is text classification. There exists a huge number of tutorials and papers out there, for example this tutorial and this survey.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.