Documentation

Naive Bayes Classification

Train naive Bayes classifiers

Naive Bayes models assume that observations have some multivariate distribution given class membership, but the predictor or features composing the observation are independent. This framework can accommodate a complete feature set such that an observation is a set of multinomial counts.

To train a naive Bayes model, use fitcnb. After training a naive Bayes model, predict labels or estimate posterior probabilities by passing the model and predictor data to predict.

Functions

fitcnb Train multiclass naive Bayes model
predict Predict classification for naive Bayes models
templateNaiveBayes Naive Bayes classifier template
loss Classification error for naive Bayes classifier
crossval Cross-validated naive Bayes classifier
logP Log unconditional probability density for naive Bayes classifier

Classes

ClassificationNaiveBayes Naive Bayes classification
CompactClassificationNaiveBayes Compact naive Bayes classifier
ClassificationPartitionedModel Cross-validated classification model

Examples and How To

Was this topic helpful?