Package org.tribuo.sequence
Class IndependentSequenceTrainer<T extends Output<T>>
java.lang.Object
org.tribuo.sequence.IndependentSequenceTrainer<T>
- Type Parameters:
T
- The output type.
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<TrainerProvenance>
,SequenceTrainer<T>
public class IndependentSequenceTrainer<T extends Output<T>>
extends Object
implements SequenceTrainer<T>
Trains a sequence model by training a regular model to independently predict every example in each sequence.
-
Constructor Summary
ConstructorDescriptionIndependentSequenceTrainer
(Trainer<T> innerTrainer) Builds a sequence trainer which uses aTrainer
to independently predict each sequence element. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of times the train method has been invoked.toString()
train
(SequenceDataset<T> sequenceExamples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> runProvenance) Trains a sequence prediction model using the examples in the given data set.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
Methods inherited from interface org.tribuo.sequence.SequenceTrainer
train
-
Constructor Details
-
IndependentSequenceTrainer
Builds a sequence trainer which uses aTrainer
to independently predict each sequence element.- Parameters:
innerTrainer
- The trainer to use.
-
-
Method Details
-
train
public IndependentSequenceModel<T> train(SequenceDataset<T> sequenceExamples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> runProvenance) Description copied from interface:SequenceTrainer
Trains a sequence prediction model using the examples in the given data set.- Specified by:
train
in interfaceSequenceTrainer<T extends Output<T>>
- Parameters:
sequenceExamples
- the data set containing the examples.runProvenance
- Training run specific provenance (e.g., fold number).- Returns:
- a predictive model that can be used to generate predictions for new examples.
-
getInvocationCount
public int getInvocationCount()Description copied from interface:SequenceTrainer
Returns the number of times the train method has been invoked.- Specified by:
getInvocationCount
in interfaceSequenceTrainer<T extends Output<T>>
- Returns:
- The number of times train has been invoked.
-
toString
-
getProvenance
-