Skip to main content

Spam filtering module with Machine Learning using SVM.

Project description

Spam filtering module with Machine Learning using SVM. spampy is a classifier that uses Support Vector Machines which tries to classify given raw emails if they are spam or not.

Support vector machines (SVMs) are supervised learning models with associated learning algorithms that analyze data used for classification and regression analysis. Given a set of training examples, each marked as belonging to one or the other of two categories, an SVM training algorithm builds a model that assigns new examples to one category or the other, making it a non-probabilistic binary linear classifier.

Many email services today provide spam filters that are able to classify emails into spam and non-spam email with high accuracy. spampy is a learning project that you can use filtering spam mails.

spampy uses two different datasets for classification. One of the datasets is already imported inside the project under spampy/datasets/ folder. Second dataset is enron-spam dataset and inside the spampy folder I created a shell script which downloads and extract it for you.

Project tree

  • email_processor Helper to collect features and labels from datasets.
  • spam_classifier Classifies given raw emails.
  • dataset_downloader Enron dataset downloader which uses dataset_downloader.sh

Dependency List

  • scikit_learn
  • scipy
  • numpy
  • nltk
  • click (for CLI)

Two main function of spam_classifier classifies given raw email.

  • classify_email
  • classify_email_with_enron

CLI

For available commands python -m spampy -h

Spam filtering module with Machine Learning using SVM.
Usage
  $ python spampy [<options>]
Options
  --help, -h              Display help message
  --download, -d          Download enron dataset
  --eclassify, -ec        Classify given raw email with enron dataset, prompts for raw email
  --classify, -c          Classify given raw email, prompts for raw email
  --version, -v           Display installed version
Examples
  $ python spampy --help
  $ python spampy --download
  $ python spampy --eclassify
  $ python spampy --classify

Project details


Release history Release notifications

This version

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for spampy, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size spampy-0.1.0-py3-none-any.whl (557.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page