Products & Services Solutions Academia Support User Community Company

Learn more about Statistics Toolbox   

fit - Class: NaiveBayes

Create Naive Bayes classifier object by fitting training data

Syntax

nb = NaiveBayes.fit(training, class)
nb = NaiveBayes.fit(..., 'param1',val1, 'param2',val2, ...)

Description

nb = NaiveBayes.fit(training, class) builds a NaiveBayes classifier object nb. training is an N-by-D numeric matrix of training data. Rows of training correspond to observations; columns correspond to features. class is a classing variable for training (see Grouped Data) taking K distinct levels. Each element of class defines which class the corresponding row of training belongs to. training and class must have the same number of rows.

nb = NaiveBayes.fit(..., 'param1',val1, 'param2',val2, ...) specifies one or more of the following name/value pairs:

See Also

Naive Bayes Classification, Grouped Data

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS