public class CompoundNaiveBayesTrainer extends SingleLabelDatasetTrainer<CompoundNaiveBayesModel>
GaussianNaiveBayesTrainer
and DiscreteNaiveBayesTrainer
. To distinguish which features with which trainer
should be used, each trainer should have a collection of feature ids which should be skipped. It can be set by #setFeatureIdsToSkip()
method.DatasetTrainer.EmptyDatasetException
envBuilder, environment
Constructor and Description |
---|
CompoundNaiveBayesTrainer() |
Modifier and Type | Method and Description |
---|---|
<K,V> CompoundNaiveBayesModel |
fitWithInitializedDeployingContext(DatasetBuilder<K,V> datasetBuilder,
Preprocessor<K,V> extractor)
Trains model based on the specified data.
|
boolean |
isUpdateable(CompoundNaiveBayesModel mdl) |
protected <K,V> CompoundNaiveBayesModel |
updateModel(CompoundNaiveBayesModel mdl,
DatasetBuilder<K,V> datasetBuilder,
Preprocessor<K,V> extractor)
Gets state of model in arguments, update in according to new data and return new model.
|
CompoundNaiveBayesTrainer |
withDiscreteFeatureIdsToSkip(Collection<Integer> discreteFeatureIdsToSkip)
Sets feature ids to skip in discrete Bayes.
|
CompoundNaiveBayesTrainer |
withDiscreteNaiveBayesTrainer(DiscreteNaiveBayesTrainer discreteNaiveBayesTrainer)
Sets a discrete trainer.
|
CompoundNaiveBayesTrainer |
withEnvironmentBuilder(LearningEnvironmentBuilder envBuilder)
Changes learning Environment.
|
CompoundNaiveBayesTrainer |
withGaussianFeatureIdsToSkip(Collection<Integer> gaussianFeatureIdsToSkip)
Sets feature ids to skip in Gaussian Bayes.
|
CompoundNaiveBayesTrainer |
withGaussianNaiveBayesTrainer(GaussianNaiveBayesTrainer gaussianNaiveBayesTrainer)
Sets a gaussian trainer.
|
CompoundNaiveBayesTrainer |
withPriorProbabilities(double[] priorProbabilities)
Sets prior probabilities.
|
fit, fit, fit, fit, fit, fit, getLastTrainedModelOrThrowEmptyDatasetException, identityTrainer, learningEnvironment, update, update, update, update, update, withConvertedLabels
public <K,V> CompoundNaiveBayesModel fitWithInitializedDeployingContext(DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> extractor)
fitWithInitializedDeployingContext
in class DatasetTrainer<CompoundNaiveBayesModel,Double>
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.datasetBuilder
- Dataset builder.extractor
- Extractor of UpstreamEntry
into LabeledVector
.public boolean isUpdateable(CompoundNaiveBayesModel mdl)
isUpdateable
in class DatasetTrainer<CompoundNaiveBayesModel,Double>
mdl
- Model.public CompoundNaiveBayesTrainer withEnvironmentBuilder(LearningEnvironmentBuilder envBuilder)
withEnvironmentBuilder
in class DatasetTrainer<CompoundNaiveBayesModel,Double>
envBuilder
- Learning environment builder.protected <K,V> CompoundNaiveBayesModel updateModel(CompoundNaiveBayesModel mdl, DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> extractor)
updateModel
in class DatasetTrainer<CompoundNaiveBayesModel,Double>
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.mdl
- Learned model.datasetBuilder
- Dataset builder.extractor
- Extractor of UpstreamEntry
into LabeledVector
.public CompoundNaiveBayesTrainer withPriorProbabilities(double[] priorProbabilities)
public CompoundNaiveBayesTrainer withGaussianNaiveBayesTrainer(GaussianNaiveBayesTrainer gaussianNaiveBayesTrainer)
public CompoundNaiveBayesTrainer withDiscreteNaiveBayesTrainer(DiscreteNaiveBayesTrainer discreteNaiveBayesTrainer)
public CompoundNaiveBayesTrainer withGaussianFeatureIdsToSkip(Collection<Integer> gaussianFeatureIdsToSkip)
public CompoundNaiveBayesTrainer withDiscreteFeatureIdsToSkip(Collection<Integer> discreteFeatureIdsToSkip)
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.0 Release Date : September 11 2021