Giter VIP home page Giter VIP logo

kdwcse / email-spam-classifier-using-naive-bayes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nikhilkr29/email-spam-classifier-using-naive-bayes

0.0 0.0 0.0 3.52 MB

A Naive Bayes spam/ham classifier based on Bayes' Theorem. A bunch of email subject is first used to train the classifier and then a previously unseen email subject is fed to predict whether it is Spam or Ham.

Jupyter Notebook 100.00%

email-spam-classifier-using-naive-bayes's Introduction

Goal :

From a dataset containing various Subjects of emails which are classified as either Spam or as Ham (Not Spam).
We are required to predict whether given an Email subject whether it is Spam or Ham.

How we Implemented it :

We implemented it by first using CountVectorizer on the Text of email and after that we applied the MultinomialNB method from the NaiveBayes Classifier.

What is Naive Bayes:

It is a classification technique based on Bayes' Theorem with an assumption of independence among predictors. In simple terms, a Naive Bayes classifier assumes that the presence of a particular feature in a class is unrelated to the presence of any other feature.

Python Libraries used:

pandas, numpy, CountVectorizer and MultinomialNB from sklearn

What does CountVectorizer do:

Convert a collection of text documents to a matrix of token counts This implementation produces a sparse representation of the counts using scipy.sparse.csr_matrix. If you do not provide an a-priori dictionary and you do not use an analyzer that does some kind of feature selection then the number of features will be equal to the vocabulary size found by analyzing the data.

email-spam-classifier-using-naive-bayes's People

Contributors

nikhilkr29 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.