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.public static class VectorNaiveBayesCategorizer.OnlineLearner<CategoryType,DistributionType extends UnivariateProbabilityDensityFunction> extends AbstractBatchAndIncrementalLearner<InputOutputPair<? extends Vectorizable,CategoryType>,VectorNaiveBayesCategorizer<CategoryType,DistributionType>>
Modifier and Type | Field and Description |
---|---|
protected IncrementalLearner<? super java.lang.Double,DistributionType> |
distributionLearner
The incremental learner for the distribution used to represent each
dimension.
|
Constructor and Description |
---|
OnlineLearner()
Creates a new learner with a null distribution learner.
|
OnlineLearner(IncrementalLearner<? super java.lang.Double,DistributionType> distributionLearner)
Creates a new learner with a given distribution learner.
|
Modifier and Type | Method and Description |
---|---|
VectorNaiveBayesCategorizer<CategoryType,DistributionType> |
createInitialLearnedObject()
Creates a new initial learned object, before any data is given.
|
IncrementalLearner<? super java.lang.Double,DistributionType> |
getDistributionLearner()
Gets the learner used for the distribution representing each
dimension.
|
void |
setDistributionLearner(IncrementalLearner<? super java.lang.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. |
clone, learn, learn, update
protected IncrementalLearner<? super java.lang.Double,DistributionType extends UnivariateProbabilityDensityFunction> distributionLearner
public OnlineLearner()
public OnlineLearner(IncrementalLearner<? super java.lang.Double,DistributionType> distributionLearner)
distributionLearner
- The learner for the distribution representing each dimension.public VectorNaiveBayesCategorizer<CategoryType,DistributionType> createInitialLearnedObject()
IncrementalLearner
public void update(VectorNaiveBayesCategorizer<CategoryType,DistributionType> target, InputOutputPair<? extends Vectorizable,CategoryType> data)
IncrementalLearner
update
method updates an object of ResultType
using
the given new data of type DataType
, using some form of
"learning" algorithm.target
- The object to update.data
- The new data for the learning algorithm to use to update
the object.public IncrementalLearner<? super java.lang.Double,DistributionType> getDistributionLearner()
public void setDistributionLearner(IncrementalLearner<? super java.lang.Double,DistributionType> distributionLearner)
distributionLearner
- The distribution learner.