public class MultinomialNaiveBayesTrainer extends Object implements Trainer<Label>, WeightedExamples
Trainer
which trains a multinomial Naive Bayes model with Laplace smoothing.
All feature values must be non-negative.
See:
Wang S, Manning CD. "Baselines and Bigrams: Simple, Good Sentiment and Topic Classification" Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics, 2012.
DEFAULT_SEED
Constructor and Description |
---|
MultinomialNaiveBayesTrainer() |
MultinomialNaiveBayesTrainer(double alpha) |
Modifier and Type | Method and Description |
---|---|
int |
getInvocationCount()
The number of times this trainer instance has had it's train method invoked.
|
TrainerProvenance |
getProvenance() |
String |
toString() |
Model<Label> |
train(Dataset<Label> examples,
Map<String,com.oracle.labs.mlrg.olcut.provenance.Provenance> runProvenance)
Trains a predictive model using the examples in the given data set.
|
public MultinomialNaiveBayesTrainer()
public MultinomialNaiveBayesTrainer(double alpha)
public Model<Label> train(Dataset<Label> examples, Map<String,com.oracle.labs.mlrg.olcut.provenance.Provenance> runProvenance)
Trainer
public int getInvocationCount()
Trainer
This is used to determine how many times the trainer's RNG has been accessed to ensure replicability in the random number stream.
getInvocationCount
in interface Trainer<Label>
public TrainerProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<TrainerProvenance>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.