This is a Python script that classifies emails as either spam or not spam (ham) using machine learning. The script uses a supervised learning algorithm to train a model on a dataset of emails that have been labeled as either spam or ham.
To use this script, you need to have the following installed on your system:
To install the required packages, run the following command in your terminal:
To use the script, follow these steps:
The script will train the model on the dataset and save the model to a file named spam_classifier.pkl
.
The script will output either “SPAM” or “HAM” depending on whether the email is classified as spam or not.
The dataset used to train the model is the SpamAssassin Public Corpus. The dataset consists of over 5,000 labeled emails, with approximately 40% of them being spam and 60% of them is not spam.
This script is released under the MIT License. See the LICENSE file for more details.