Git Product home page Git Product logo

naive-bayes-algorithm-from-scratch-for-text-classification's Introduction

Naive-Bayes-algorithm-from-scratch-for-Text-classification

Naïve Bayes Algorithm is implemented in order to classify spam and not spam emails.

Dataset.zip : Dataset contains training and test set. Each set consists of spam and ham directories. All the files in spam set are spam emails and files in ham set are non-spam emails.

The implemented algorithm uses add-one smoothing. The algorithm is also improved using two follwing approaches:

  1. Filtering the Stop Words - The list of stop words is in stopwords.txt.
  2. Feature Selection - select various top % of features (words) from the dictionary in training dataset seperatley for spam and ham.

In the end accuracy for test data is shown for general naive bayes implementation, naive bayes after removing stop words and naive bayes for feature selection (10%, 20%,..., 100%). The results are comapred and visulaized through graaphs for checking how accuracy improves.

** Please remember to change the file location in the program to load the corpus for spam and ham in test_spam, test_ham, train_spam, train_ham.

naive-bayes-algorithm-from-scratch-for-text-classification's People

Contributors

prigarg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

surathisin

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.