Naive Bayes classifier is classification algorithm. It uses Naive based Bernoulli and Multinomial equation to classify documents(Text) as ham or spam.
Switch branches/tags
Nothing to show
Clone or download
Latest commit e41b63f Jun 21, 2015
Permalink
Failed to load latest commit information.
.settings naive based classification Apr 16, 2015
bin data file updated Jun 21, 2015
jars jar files added Apr 16, 2015
src data file upated Jun 2, 2015
.classpath naive based classification Apr 16, 2015
.gitignore naive based classification Apr 16, 2015
.project naive based classification Apr 16, 2015
README.md read me updated May 24, 2015

README.md

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 alihaider907@gmail.com or tweet me @alihaider907 Thank you