Documentation

Naive Bayes

Naive Bayes model with Gaussian, multinomial, or kernel predictors

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 in the command-line interface. After training, 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
compareHoldout Compare accuracies of two classification models using new data

Classes

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

Examples and How To

Was this topic helpful?