Class AveragingCombiner

java.lang.Object
org.tribuo.regression.ensemble.AveragingCombiner
All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>, Serializable, EnsembleCombiner<Regressor>

public class AveragingCombiner extends Object implements EnsembleCombiner<Regressor>
A combiner which performs a weighted or unweighted average of the predicted regressors independently across the output dimensions.
See Also:
  • Constructor Details

    • AveragingCombiner

      public AveragingCombiner()
      Constructs an averaging combiner.
  • Method Details

    • combine

      public Prediction<Regressor> combine(ImmutableOutputInfo<Regressor> outputInfo, List<Prediction<Regressor>> predictions)
      Description copied from interface: EnsembleCombiner
      Combine the predictions.
      Specified by:
      combine in interface EnsembleCombiner<Regressor>
      Parameters:
      outputInfo - The output domain.
      predictions - The predictions to combine.
      Returns:
      The ensemble prediction.
    • combine

      public Prediction<Regressor> combine(ImmutableOutputInfo<Regressor> outputInfo, List<Prediction<Regressor>> predictions, float[] weights)
      Description copied from interface: EnsembleCombiner
      Combine the supplied predictions. predictions.size() must equal weights.length.
      Specified by:
      combine in interface EnsembleCombiner<Regressor>
      Parameters:
      outputInfo - The output domain.
      predictions - The predictions to combine.
      weights - The weights to use for each prediction.
      Returns:
      The ensemble prediction.
    • toString

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

      public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
      Specified by:
      getProvenance in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
    • exportCombiner

      public ONNXNode exportCombiner(ONNXNode input)
      Exports this averaging combiner, writing constructed nodes into the ONNXContext governing input and returning the leaf node of the combiner.

      The input should be a 3-tensor [batch_size, num_outputs, num_ensemble_members].

      Specified by:
      exportCombiner in interface EnsembleCombiner<Regressor>
      Parameters:
      input - The node to combine
      Returns:
      A node representing the final average operation.
    • exportCombiner

      public <T extends ONNXRef<?>> ONNXNode exportCombiner(ONNXNode input, T weight)
      Exports this averaging combiner, writing constructed nodes into the ONNXContext governing input and returning the leaf node of the combiner.

      The input should be a 3-tensor [batch_size, num_outputs, num_ensemble_members].

      Specified by:
      exportCombiner in interface EnsembleCombiner<Regressor>
      Type Parameters:
      T - The type of the weights input reference.
      Parameters:
      input - The node to combine
      weight - The node of weights to use in combining.
      Returns:
      A node representing the final average operation.