Class IndependentMultiLabelTrainer

java.lang.Object
org.tribuo.multilabel.baseline.IndependentMultiLabelTrainer
All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<TrainerProvenance>, Trainer<MultiLabel>

public class IndependentMultiLabelTrainer extends Object implements Trainer<MultiLabel>
Trains n independent binary Models, each of which predicts a single Label.

Then wraps it up in an IndependentMultiLabelModel to provide a MultiLabel prediction.

It trains each model sequentially, and could be optimised to train in parallel.

  • Constructor Details

  • Method Details

    • train

      public Model<MultiLabel> train(Dataset<MultiLabel> examples, Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> runProvenance)
      Description copied from interface: Trainer
      Trains a predictive model using the examples in the given data set.
      Specified by:
      train in interface Trainer<MultiLabel>
      Parameters:
      examples - 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: Trainer
      The 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:
      getInvocationCount in interface Trainer<MultiLabel>
      Returns:
      The number of train invocations.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProvenance

      Specified by:
      getProvenance in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<TrainerProvenance>