Class VotingCombiner
java.lang.Object
org.tribuo.classification.ensemble.VotingCombiner
- 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<Label>
A combiner which performs a weighted or unweighted vote across the predicted labels.
This uses the most likely prediction from each ensemble member, unlike FullyWeightedVotingCombiner
which uses the full distribution of predictions for each ensemble member.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncombine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions) combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions, float[] weights) org.tribuo.util.onnx.ONNXNodeexportCombiner(org.tribuo.util.onnx.ONNXNode input) Exports this voting combiner to ONNX.<T extends org.tribuo.util.onnx.ONNXRef<?>>
org.tribuo.util.onnx.ONNXNodeexportCombiner(org.tribuo.util.onnx.ONNXNode input, T weight) Exports this voting combiner to ONNXcom.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenancetoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
-
Constructor Details
-
VotingCombiner
public VotingCombiner()Constructs a voting combiner.
-
-
Method Details
-
combine
public Prediction<Label> combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions) - Specified by:
combinein interfaceEnsembleCombiner<Label>
-
combine
public Prediction<Label> combine(ImmutableOutputInfo<Label> outputInfo, List<Prediction<Label>> predictions, float[] weights) - Specified by:
combinein interfaceEnsembleCombiner<Label>
-
toString
-
getProvenance
- Specified by:
getProvenancein 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:
exportCombinerin interfaceEnsembleCombiner<Label>- Parameters:
input- The input tensor to combine.- Returns:
- the final node proto representing the voting operation.
-
exportCombiner
public <T extends org.tribuo.util.onnx.ONNXRef<?>> org.tribuo.util.onnx.ONNXNode exportCombiner(org.tribuo.util.onnx.ONNXNode input, T weight) Exports this voting combiner to ONNXThe input should be a 3-tensor [batch_size, num_outputs, num_ensemble_members].
- Specified by:
exportCombinerin interfaceEnsembleCombiner<Label>- Parameters:
input- The input tensor to combine.weight- The combination weight node.- Returns:
- the final node proto representing the voting operation.
-