public final class TransformTrainer<T extends Output<T>> extends Object implements Trainer<T>
Trainer
which encapsulates another trainer plus a TransformationMap
object
to apply to each Dataset
before training each Model
.
Transformations only operate on observed values. To operate on implicit zeros then
first call MutableDataset.densify()
on the datasets.
DEFAULT_SEED
Constructor and Description |
---|
TransformTrainer(Trainer<T> innerTrainer,
TransformationMap transformations)
Creates a trainer which transforms the data before training, and stores
the transformers along with the trained model in a
TransformedModel . |
TransformTrainer(Trainer<T> innerTrainer,
TransformationMap transformations,
boolean densify)
Creates a trainer which transforms the data before training, and stores
the transformers along with the trained model in a
TransformedModel . |
Modifier and Type | Method and Description |
---|---|
int |
getInvocationCount()
The number of times this trainer instance has had it's train method invoked.
|
TrainerProvenance |
getProvenance() |
TransformedModel<T> |
train(Dataset<T> examples,
Map<String,com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance)
Trains a predictive model using the examples in the given data set.
|
public TransformTrainer(Trainer<T> innerTrainer, TransformationMap transformations)
TransformedModel
.
This constructor makes a trainer which keeps the data sparse.
innerTrainer
- The trainer to use.transformations
- The transformations to apply to the data first.public TransformTrainer(Trainer<T> innerTrainer, TransformationMap transformations, boolean densify)
TransformedModel
.innerTrainer
- The trainer to use.transformations
- The transformations to apply to the data first.densify
- Densify the dataset (and any predict time data) before training/prediction.public TransformedModel<T> train(Dataset<T> 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<T extends Output<T>>
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.