Giter Club home page Giter Club logo

naive-bayes-classifier's Introduction

Naive-Bayes-classifier

Naive Bayes classifier is classification algorithm. It uses Naive based Bernoulli and Multinomial equation to classify documents(Text) as ham or spam. Currently algorithm is only classifying in two categories but it can be modified to classify a text in N categories.

Project Structure
/jars executable jars if you don't want to run source code
/src/main source code of Naive-Bayes-classifier
/src/corpus contains all data files trainining files and testing files, list of stop words file

you can run project by either importing it in eclipse or using cmd/termianl in java based environment

Using Eclipse

  • Import Project in eclipse ( using Existing Project into Workspace option )
  • run Train.java (main class) to train you corpus using corpus_root_path as run time argument
  • After running Train.java check out Bernouli.out and Multinomail.out files at corpus_root_path. these are model build by bernouli and multinomial calculations
  • Now run Test.java (main class ) with corpus_root_path and path_of_file__you_want_to_classify as run time arguments
  • Test.java will classify your file with results of both Bernouli and Multinomial

Using Command Line

command line option is easy
  • cd jars folder
  • run command java -jar train1.jar path_of_corpus_folder
  • above command will create Bernouli and Multinomial models in corpus folder
  • run command java -jar test.jar path_of_corpus_folder    path_of_file__you_want_to_classify
  • above command will classify your file with results of both Bernouli and Multinomial

Note I will try to push regular updates on algorithm, in case you don't understand anything please hit me out at [email protected] or tweet me @alihaider907 Thank you

naive-bayes-classifier's People

Contributors

wonderer007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

chenweihua405

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.