Package org.tribuo.multilabel.ensemble
Class MultiLabelVotingCombiner
java.lang.Object
org.tribuo.multilabel.ensemble.MultiLabelVotingCombiner
- 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<MultiLabel>
A combiner which performs a weighted or unweighted vote independently across the predicted labels in each multi-label.
This uses the thresholded predictions from each ensemble member.
This class is stateless and thread safe.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncombine
(ImmutableOutputInfo<MultiLabel> outputInfo, List<Prediction<MultiLabel>> predictions) Combine the predictions.combine
(ImmutableOutputInfo<MultiLabel> outputInfo, List<Prediction<MultiLabel>> predictions, float[] weights) Combine the supplied predictions.exportCombiner
(ONNXNode input) Exports this voting combiner to ONNX.exportCombiner
(ONNXNode input, T weight) Exports this voting combiner to ONNXcom.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
toString()
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
-
Constructor Details
-
MultiLabelVotingCombiner
public MultiLabelVotingCombiner()Constructs a voting combiner.
-
-
Method Details
-
combine
public Prediction<MultiLabel> combine(ImmutableOutputInfo<MultiLabel> outputInfo, List<Prediction<MultiLabel>> predictions) Description copied from interface:EnsembleCombiner
Combine the predictions.- Specified by:
combine
in interfaceEnsembleCombiner<MultiLabel>
- Parameters:
outputInfo
- The output domain.predictions
- The predictions to combine.- Returns:
- The ensemble prediction.
-
combine
public Prediction<MultiLabel> combine(ImmutableOutputInfo<MultiLabel> outputInfo, List<Prediction<MultiLabel>> predictions, float[] weights) Description copied from interface:EnsembleCombiner
Combine the supplied predictions. predictions.size() must equal weights.length.- Specified by:
combine
in interfaceEnsembleCombiner<MultiLabel>
- Parameters:
outputInfo
- The output domain.predictions
- The predictions to combine.weights
- The weights to use for each prediction.- Returns:
- The ensemble prediction.
-
toString
-
getProvenance
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-
exportCombiner
Exports this voting combiner to ONNX.The input should be a 3-tensor [batch_size, num_outputs, num_ensemble_members].
- Specified by:
exportCombiner
in interfaceEnsembleCombiner<MultiLabel>
- Parameters:
input
- The input tensor to combine.- Returns:
- the final node proto representing the voting operation.
-
exportCombiner
Exports this voting combiner to ONNXThe input should be a 3-tensor [batch_size, num_outputs, num_ensemble_members].
- Specified by:
exportCombiner
in interfaceEnsembleCombiner<MultiLabel>
- Type Parameters:
T
- The type of the weights input reference.- Parameters:
input
- The input tensor to combine.weight
- The combination weight node.- Returns:
- the final node proto representing the voting operation.
-