Skip to content

An implementation of the Naive-Bayes-Classifier algorithm in C++.

License

Notifications You must be signed in to change notification settings

sanchitsgupta/naive-bayes-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Naive-Bayes Classifier in C++

C++ Linux PyPI license

This is an implementation of the Naive-Bayes Classifier in C++.

Running

Compile and run the classifier.cpp file.

$ g++ -o classifier classifier.cpp
$ ./classifier

Dataset Info

I used a custom dataset that has faces represented in txt files. Check out facedatatrain.txt file to understand the data.

datatrain directory contains the training files and dataset contains the testing ones.

NOTE: Code was written specifically for this dataset and will require significant changes before running on some other dataset.

Results

Accuracy: 89.3333%

Confusion Matrix

Predicted Face Predicted Non-Face
Actual Face 68 5
Actual Non-Face 11 66

Precision: 86.076%

Recall: 93.1507%

F-measure: 89.4737%