Package org.tribuo.interop.oci
Class OCILabelConverter
java.lang.Object
org.tribuo.interop.oci.OCILabelConverter
- 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
,OCIOutputConverter<Label>
A converter for
DenseMatrix
and DenseVector
into Label
Prediction
s.
If the input has length 1 it is assumed to be a single label value, otherwise it must have length = outputIDInfo.size().
- See Also:
-
Constructor Summary
ConstructorDescriptionOCILabelConverter
(boolean generatesProbabilities) Constructs an OCILabelConverter with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionconvertOutput
(DenseMatrix scores, int[] numValidFeatures, List<Example<Label>> examples, ImmutableOutputInfo<Label> outputIDInfo) Converts a dense matrix into a list of predictions of the appropriate type.convertOutput
(DenseVector scores, int numValidFeature, Example<Label> example, ImmutableOutputInfo<Label> outputIDInfo) Converts a dense vector into a single prediction of the appropriate type.boolean
boolean
Does this OCIOutputConverter generate probabilities?com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
int
hashCode()
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
-
Constructor Details
-
OCILabelConverter
public OCILabelConverter(boolean generatesProbabilities) Constructs an OCILabelConverter with the specified parameters.- Parameters:
generatesProbabilities
- Does this converter emit probabilities?
-
-
Method Details
-
convertOutput
public Prediction<Label> convertOutput(DenseVector scores, int numValidFeature, Example<Label> example, ImmutableOutputInfo<Label> outputIDInfo) Description copied from interface:OCIOutputConverter
Converts a dense vector into a single prediction of the appropriate type.- Specified by:
convertOutput
in interfaceOCIOutputConverter<Label>
- Parameters:
scores
- The score vector.numValidFeature
- The number of valid features (stored in the prediction).example
- The example (stored in the prediction).outputIDInfo
- The output information.- Returns:
- A prediction representing the value of this score vector.
-
convertOutput
public List<Prediction<Label>> convertOutput(DenseMatrix scores, int[] numValidFeatures, List<Example<Label>> examples, ImmutableOutputInfo<Label> outputIDInfo) Description copied from interface:OCIOutputConverter
Converts a dense matrix into a list of predictions of the appropriate type.- Specified by:
convertOutput
in interfaceOCIOutputConverter<Label>
- Parameters:
scores
- The score matrix.numValidFeatures
- The number of valid features in each example (stored in the prediction).examples
- The examples (stored in the prediction).outputIDInfo
- The output information.- Returns:
- A list of predictions representing the value of this score matrix.
-
generatesProbabilities
public boolean generatesProbabilities()Description copied from interface:OCIOutputConverter
Does this OCIOutputConverter generate probabilities?- Specified by:
generatesProbabilities
in interfaceOCIOutputConverter<Label>
- Returns:
- True if it produces a probability distribution in the
Prediction
.
-
toString
-
equals
-
hashCode
public int hashCode() -
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>
-