This project is a spam filter module with Machine Learning based on Python using Bayes. This filter use Classic Naive Bayes to classify given mails basing on wether they are spam or not.
This Spam filter use dataset from kaggle to train and test. the dataset contains 5573 email, among them 13% is spam and rest of them is healthy.
you can check they in spam.csv file.
In machine learning, naive Bayes classifiers are a family of simple "probabilistic classifiers" based on applying Bayes' theorem with strong (naive) independence assumptions between the features.
Abstractly, naive Bayes is a conditional probability model: given a problem instance to be classified, represented by a vector

representing some n features (independent variables), it assigns to this instance probabilities

The problem with the above formulation is that if the number of features n is large or if a feature can take on a large number of values, then basing such a model on probability tables is infeasible. We therefore reformulate the model to make it more tractable. Using Bayes' theorem, the conditional probability can be decomposed as

Naive_Bayes
- Naive_Bayes.py
collect feature and lable, and classify email. - train.py
using dataset to train classify moudle. - test.py
classify a give number of mails and output the error rate
Dependency List
- numpy
- panda
- re
Using 5574 traing spam. Classfiying 1000 mails, the average error rate is 0.9%