Documentation of 'jsat.classifiers.bayesian.NaiveBayesUpdateable' Java class
NaiveBayesUpdateable
jsat.classifiers.bayesian

Class NaiveBayesUpdateable

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Classifier, UpdateableClassifier


    public class NaiveBayesUpdateable
    extends BaseUpdateableClassifier
    An implementation of Gaussian Naive Bayes that can be updated in an online fashion. The ability to be updated comes at the cost to slower training and classification time. However NB is already very fast, so the difference is not significant.
    The more advanced distribution detection of NaiveBayes is not possible in online form.
    See Also:
    Serialized Form
    • Constructor Detail

      • NaiveBayesUpdateable

        public NaiveBayesUpdateable()
        Creates a new Naive Bayes classifier that assumes sparce input vectors
      • NaiveBayesUpdateable

        public NaiveBayesUpdateable(boolean sparse)
        Creates a new Naive Bayes classifier
        Parameters:
        sparse - whether or not to assume input vectors are sparce
    • Method Detail

      • setUp

        public void setUp(CategoricalData[] categoricalAttributes,
                          int numericAttributes,
                          CategoricalData predicting)
        Description copied from interface: UpdateableClassifier
        Prepares the classifier to begin learning from its UpdateableClassifier.update(jsat.classifiers.DataPoint, int) method.
        Parameters:
        categoricalAttributes - an array containing the categorical attributes that will be in each data point
        numericAttributes - the number of numeric attributes that will be in each data point
        predicting - the information for the target class that will be predicted
      • update

        public void update(DataPoint dataPoint,
                           int targetClass)
        Description copied from interface: UpdateableClassifier
        Updates the classifier by giving it a new data point to learn from.
        Parameters:
        dataPoint - the data point to learn
        targetClass - the target class of the data point
      • classify

        public CategoricalResults classify(DataPoint data)
        Description copied from interface: Classifier
        Performs classification on the given data point.
        Parameters:
        data - the data point to classify
        Returns:
        the results of the classification.
      • supportsWeightedData

        public boolean supportsWeightedData()
        Description copied from interface: Classifier
        Indicates whether the model knows how to train using weighted data points. If it does, the model will train assuming the weights. The values returned by this method may change depending on the parameters set for the model.
        Returns:
        true if the model supports weighted data, false otherwise
      • isSparseInput

        public boolean isSparseInput()
        Returns true if the input is assume sparse
        Returns:
        true if the input is assume sparse
      • setSparse

        public void setSparse(boolean sparseInput)
        Sets whether or not that classifier should behave as if the input vectors are sparse. This means zero values in the input will be ignored when performing classification.
        Parameters:
        sparseInput - true to use a sparse model

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.