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

nb = NaiveBayes.fit(training, class)
builds
a NaiveBayes
classifier object nb
. training
is
an N
byD
numeric matrix of
training data. Rows of training
correspond to observations;
columns correspond to features. class
is a classing
variable for training
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:
'Distribution'
– a character
vector or a 1byD
cell array of character vectors,
specifying which distributions fit
uses to model
the data. If the value is a , fit
models all the
features using one type of distribution. fit
can
also model different features using different types of distributions.
If the value is a cell array, its j
th element specifies
the distribution fit
uses for the j
th
feature. The available types of distributions are:
'normal' (default)  Normal (Gaussian) distribution. 
'kernel'  Kernel smoothing density estimate. 
'mvmn'  Multivariate multinomial distribution for discrete data. fit assumes
each individual feature follows a multinomial model within a class.
The parameters for a feature include the probabilities of all possible
values that the corresponding feature can take. 
'mn'  Multinomial distribution for classifying the countbased
data such as the bagoftokens model. In the bagoftokens model,
the value of the If
you specify 
'Prior'
– The prior probabilities
for the classes, specified as one of the following:
'empirical' (default)  fit estimates the prior probabilities from
the relative frequencies of the classes in training . 
'uniform'  The prior probabilities are equal for all classes. 
vector  A numeric vector of length K specifying
the prior probabilities in the class order of class . 
structure  A structure S containing class levels and
their prior probabilities. S must have two fields:

If the prior probabilities don't sum to one, fit
will
normalize them.
'KSWidth'
– The bandwidth
of the kernel smoothing window. The default is to select a default
bandwidth automatically for each combination of feature and class,
using a value that is optimal for a Gaussian distribution. You can
specify the value as one of the following:
scalar  Width for all features in all classes. 
row vector  1byD vector where the j th
element is the bandwidth for the j th feature in
all classes. 
column vector  K by1 vector where the i th
element specifies the bandwidth for all features in the i th
class. K represents the number of class levels. 
matrix  K byD matrix M where M(i,j) specifies
the bandwidth for the j th feature in the i th
class. 
structure  A structure S containing class levels and
their bandwidths. S must have two fields:

'KSSupport'
– The regions
where the density can be applied. It can be 'unbounded'
(default), 'positive'
,
a twoelement vector as shown below, or a 1byD
cell
array of these values:
'unbounded' (default)  The density can extend over the whole real line. 
'positive'  The density is restricted to positive values. 
[L,U]  A twoelement vector specifying the finite lower bound L and
upper bound U for the support of the density. 
'KSType'
– The type of
kernel smoother to use. It can be 'normal'
(default), 'box'
, 'triangle'
, 'epanechnikov'
,
or a 1byD
cell array of these values.