"NaiveBayes"
(Machine Learning Method)

  • Method for Classify.
  • Determines the class using Bayes's theorem and assuming that features are independent given the class.
  • Details & Suboptions
  • Naive Bayes is a classification technique based on Bayes's theorem which assumes that the features are independent given the class. The class probabilities for a given example are then: , where is the probability distribution of feature given the class, and is the prior probability of the class. Both distributions are estimated from the training data. In the current implementation, distributions are modeled using a piecewise-constant function (i.e a variable-width histogram).
  • The following suboption can be given
  • "SmoothingParameter".2regularization parameter
  • Examples

    open allclose all

    Basic Examples  (2)

    Train a classifier function on labeled examples:

    In[1]:=
    Click for copyable input
    Out[1]=

    Look at its ClassifierInformation:

    In[2]:=
    Click for copyable input
    Out[2]=

    Classify a new example:

    In[3]:=
    Click for copyable input
    Out[3]=

    Generate some normally distributed data:

    In[1]:=
    Click for copyable input
    In[2]:=
    Click for copyable input

    Visualize it:

    In[3]:=
    Click for copyable input
    Out[3]=

    Train a classifier on this dataset:

    In[4]:=
    Click for copyable input
    Out[4]=

    Plot the training set and the probability distribution of each class as a function of the features:

    In[5]:=
    Click for copyable input
    Out[5]=

    Options  (2)

    See Also

    ClassifierFunction  ClassifierMeasurements  ClassifierInformation  Predict  SequencePredict  ClusterClassify

    Related Methods