gov.sandia.cognition.learning.algorithm.bayes
Class VectorNaiveBayesCategorizer.OnlineLearner<CategoryType,DistributionType extends UnivariateProbabilityDensityFunction>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.AbstractBatchAndIncrementalLearner<InputOutputPair<? extends Vectorizable,CategoryType>,VectorNaiveBayesCategorizer<CategoryType,DistributionType>>
          extended by gov.sandia.cognition.learning.algorithm.bayes.VectorNaiveBayesCategorizer.OnlineLearner<CategoryType,DistributionType>
Type Parameters:
CategoryType - The output category type for the categorizer. Must implement equals and hash code.
DistributionType - The type of the distributions used to compute the conditionals for each dimension.
All Implemented Interfaces:
BatchAndIncrementalLearner<InputOutputPair<? extends Vectorizable,CategoryType>,VectorNaiveBayesCategorizer<CategoryType,DistributionType>>, BatchLearner<Collection<? extends InputOutputPair<? extends Vectorizable,CategoryType>>,VectorNaiveBayesCategorizer<CategoryType,DistributionType>>, IncrementalLearner<InputOutputPair<? extends Vectorizable,CategoryType>,VectorNaiveBayesCategorizer<CategoryType,DistributionType>>, CloneableSerializable, Serializable, Cloneable
Enclosing class:
VectorNaiveBayesCategorizer<CategoryType,DistributionType extends UnivariateProbabilityDensityFunction>

public static class VectorNaiveBayesCategorizer.OnlineLearner<CategoryType,DistributionType extends UnivariateProbabilityDensityFunction>
extends AbstractBatchAndIncrementalLearner<InputOutputPair<? extends Vectorizable,CategoryType>,VectorNaiveBayesCategorizer<CategoryType,DistributionType>>

An online (incremental) distributionLearner for the Naive Bayes categorizer that uses an incremental distribution learner for the distribution representing each dimension for each category.

Since:
3.3.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
protected  IncrementalLearner<? super Double,DistributionType> distributionLearner
          The incremental learner for the distribution used to represent each dimension.
 
Constructor Summary
VectorNaiveBayesCategorizer.OnlineLearner()
          Creates a new learner with a null distribution learner.
VectorNaiveBayesCategorizer.OnlineLearner(IncrementalLearner<? super Double,DistributionType> distributionLearner)
          Creates a new learner with a given distribution learner.
 
Method Summary
 VectorNaiveBayesCategorizer<CategoryType,DistributionType> createInitialLearnedObject()
          Creates a new initial learned object, before any data is given.
 IncrementalLearner<? super Double,DistributionType> getDistributionLearner()
          Gets the learner used for the distribution representing each dimension.
 void setDistributionLearner(IncrementalLearner<? super Double,DistributionType> distributionLearner)
          Sets the learner used for the distribution representing each dimension.
 void update(VectorNaiveBayesCategorizer<CategoryType,DistributionType> target, InputOutputPair<? extends Vectorizable,CategoryType> data)
          The update method updates an object of ResultType using the given new data of type DataType, using some form of "learning" algorithm.
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.AbstractBatchAndIncrementalLearner
clone, learn, learn, update
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

distributionLearner

protected IncrementalLearner<? super Double,DistributionType extends UnivariateProbabilityDensityFunction> distributionLearner
The incremental learner for the distribution used to represent each dimension. By the generic, it must learn a univariate probability density function.

Constructor Detail

VectorNaiveBayesCategorizer.OnlineLearner

public VectorNaiveBayesCategorizer.OnlineLearner()
Creates a new learner with a null distribution learner.


VectorNaiveBayesCategorizer.OnlineLearner

public VectorNaiveBayesCategorizer.OnlineLearner(IncrementalLearner<? super Double,DistributionType> distributionLearner)
Creates a new learner with a given distribution learner.

Parameters:
distributionLearner - The learner for the distribution representing each dimension.
Method Detail

createInitialLearnedObject

public VectorNaiveBayesCategorizer<CategoryType,DistributionType> createInitialLearnedObject()
Description copied from interface: IncrementalLearner
Creates a new initial learned object, before any data is given.

Returns:
The initial learned object.

update

public void update(VectorNaiveBayesCategorizer<CategoryType,DistributionType> target,
                   InputOutputPair<? extends Vectorizable,CategoryType> data)
Description copied from interface: IncrementalLearner
The update method updates an object of ResultType using the given new data of type DataType, using some form of "learning" algorithm.

Parameters:
target - The object to update.
data - The new data for the learning algorithm to use to update the object.

getDistributionLearner

public IncrementalLearner<? super Double,DistributionType> getDistributionLearner()
Gets the learner used for the distribution representing each dimension.

Returns:
The distribution learner.

setDistributionLearner

public void setDistributionLearner(IncrementalLearner<? super Double,DistributionType> distributionLearner)
Sets the learner used for the distribution representing each dimension.

Parameters:
distributionLearner - The distribution learner.