Skip to content

nanfengpo/abin-naive-bayes-classifier

 
 

Repository files navigation

NaiveBayesClassifier

A Naive Bayes Classifier project/practice of Machine learning

Naive Bayes is a simple technique for constructing classifiers: models that assign class labels to problem instances, represented as vectors of feature values, where the class labels are drawn from some finite set. It is not a single algorithm for training such classifiers, but a family of algorithms based on a common principle: all naive Bayes classifiers assume that the value of a particular feature is independent of the value of any other feature, given the class variable. For example, a fruit may be considered to be an apple if it is red, round, and about 10 cm in diameter. A naive Bayes classifier considers each of these features to contribute independently to the probability that this fruit is an apple, regardless of any possible correlations between the color, roundness and diamete features.-Wiki

NB_train.py

This would calculate probability of train data set.

NB_predict.py

By loading probability of train data set, train label and test data, this code would give you Naive Bayes prediction of test data.

NB_accuracy.py

A simple code to calculate accuracy of prediction of test data set.

About

Naive bayes classifier project/practice of Machine learning

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 71.1%
  • Jupyter Notebook 28.9%