Class DummyClassifierTrainer
java.lang.Object
org.tribuo.classification.baseline.DummyClassifierTrainer
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable,com.oracle.labs.mlrg.olcut.provenance.Provenancable<TrainerProvenance>,Trainer<Label>
A trainer for simple baseline classifiers. Use this only for comparison purposes, if you can't beat these
baselines, your ML system doesn't work.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTypes of dummy classifier. -
Field Summary
Fields inherited from interface org.tribuo.Trainer
DEFAULT_SEED, INCREMENT_INVOCATION_COUNT -
Method Summary
Modifier and TypeMethodDescriptionstatic DummyClassifierTrainercreateConstantTrainer(String constantLabel) Creates a trainer which creates models which return a fixed label.static DummyClassifierTrainerCreates a trainer which creates models which return a fixed label, the one which was most frequent in the training data.static DummyClassifierTrainercreateStratifiedTrainer(long seed) Creates a trainer which creates models which return random labels sampled from the training label distribution.static DummyClassifierTrainercreateUniformTrainer(long seed) Creates a trainer which creates models which return random labels sampled uniformly from the labels seen at training time.intvoidUsed by the OLCUT configuration system, and should not be called by external code.voidsetInvocationCount(int invocationCount) toString()train(Dataset<Label> examples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance) train(Dataset<Label> examples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance, int invocationCount)
-
Method Details
-
postConfig
Used by the OLCUT configuration system, and should not be called by external code.- Specified by:
postConfigin interfacecom.oracle.labs.mlrg.olcut.config.Configurable
-
train
-
train
-
getInvocationCount
- Specified by:
getInvocationCountin interfaceTrainer<Label>
-
setInvocationCount
- Specified by:
setInvocationCountin interfaceTrainer<Label>
-
toString
-
getProvenance
- Specified by:
getProvenancein interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<TrainerProvenance>
-
createStratifiedTrainer
Creates a trainer which creates models which return random labels sampled from the training label distribution.- Parameters:
seed- The RNG seed to use.- Returns:
- A classification trainer.
-
createConstantTrainer
Creates a trainer which creates models which return a fixed label.- Parameters:
constantLabel- The label to return.- Returns:
- A classification trainer.
-
createUniformTrainer
Creates a trainer which creates models which return random labels sampled uniformly from the labels seen at training time.- Parameters:
seed- The RNG seed to use.- Returns:
- A classification trainer.
-
createMostFrequentTrainer
Creates a trainer which creates models which return a fixed label, the one which was most frequent in the training data.- Returns:
- A classification trainer.
-