Class TransformTrainer<T extends Output<T>>
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable,com.oracle.labs.mlrg.olcut.provenance.Provenancable<TrainerProvenance>,Trainer<T>
Trainer which encapsulates another trainer plus a TransformationMap object
to apply to each Dataset before training each Model.
By default transformations only operate on explicit feature values. To include implicit zeros
in transformation fitting set includeImplicitZeroFeatures. To convert implicit
zeros to explicit zeros before applying the transformations set densify.
See org.tribuo.transform for a more detailed discussion of these parameters.
-
Field Summary
Fields inherited from interface org.tribuo.Trainer
DEFAULT_SEED -
Constructor Summary
ConstructorsConstructorDescriptionTransformTrainer(Trainer<T> innerTrainer, TransformationMap transformations) Creates a trainer which transforms the data before training, and stores the transformers along with the trained model in aTransformedModel.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 aTransformedModel.TransformTrainer(Trainer<T> innerTrainer, TransformationMap transformations, boolean densify, boolean includeImplicitZeroFeatures) Creates a trainer which transforms the data before training, and stores the transformers along with the trained model in aTransformedModel. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
-
Constructor Details
-
TransformTrainer
Creates a trainer which transforms the data before training, and stores the transformers along with the trained model in aTransformedModel.Sets
observeSparseto false and so this constructor makes a trainer which keeps the data sparse, and does not use the implicit zeros to construct the transformations. Models produced by this trainer will not convert implicit zeros in the feature space to explicit zeros (i.e., densify is false).- Parameters:
innerTrainer- The trainer to use.transformations- The transformations to apply to the data first.
-
TransformTrainer
public 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 aTransformedModel.Sets
observeSparseto false and so this constructor makes a trainer which keeps the data sparse, and does not use the implicit zeros to construct the transformations.- Parameters:
innerTrainer- The trainer to use.transformations- The transformations to apply to the data first.densify- Convert the implicit zeros in each training and prediction example to explicit zeros before training/prediction.
-
TransformTrainer
public TransformTrainer(Trainer<T> innerTrainer, TransformationMap transformations, boolean densify, boolean includeImplicitZeroFeatures) Creates a trainer which transforms the data before training, and stores the transformers along with the trained model in aTransformedModel.- Parameters:
innerTrainer- The trainer to use.transformations- The transformations to apply to the data first.densify- Convert the implicit zeros in each training and prediction example to explicit zeros before training/prediction.includeImplicitZeroFeatures- Use the implicit zero feature values to construct the transformations.
-
-
Method Details
-
train
-
getInvocationCount
public int getInvocationCount()Description copied from interface:TrainerThe number of times this trainer instance has had it's train method invoked.This is used to determine how many times the trainer's RNG has been accessed to ensure replicability in the random number stream.
- Specified by:
getInvocationCountin interfaceTrainer<T extends Output<T>>- Returns:
- The number of train invocations.
-
getProvenance
-