public final class DummyClassifierTrainer extends Object implements Trainer<Label>
Modifier and Type | Class and Description |
---|---|
static class |
DummyClassifierTrainer.DummyType
Types of dummy classifier.
|
DEFAULT_SEED
Modifier and Type | Method and Description |
---|---|
static DummyClassifierTrainer |
createConstantTrainer(String constantLabel)
Creates a trainer which creates models which return a fixed label.
|
static DummyClassifierTrainer |
createMostFrequentTrainer()
Creates a trainer which creates models which return a fixed label, the one which was most frequent in the training data.
|
static DummyClassifierTrainer |
createStratifiedTrainer(long seed)
Creates a trainer which creates models which return random labels sampled from the training label distribution.
|
static DummyClassifierTrainer |
createUniformTrainer(long seed)
Creates a trainer which creates models which return random labels sampled uniformly from the labels seen at training time.
|
int |
getInvocationCount()
The number of times this trainer instance has had it's train method invoked.
|
TrainerProvenance |
getProvenance() |
void |
postConfig()
Used by the OLCUT configuration system, and should not be called by external code.
|
String |
toString() |
Model<Label> |
train(Dataset<Label> examples,
Map<String,com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance)
Trains a predictive model using the examples in the given data set.
|
public void postConfig()
postConfig
in interface com.oracle.labs.mlrg.olcut.config.Configurable
public Model<Label> train(Dataset<Label> examples, Map<String,com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance)
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>
public static DummyClassifierTrainer createStratifiedTrainer(long seed)
seed
- The RNG seed to use.public static DummyClassifierTrainer createConstantTrainer(String constantLabel)
constantLabel
- The label to return.public static DummyClassifierTrainer createUniformTrainer(long seed)
seed
- The RNG seed to use.public static DummyClassifierTrainer createMostFrequentTrainer()
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.