Class RegressorTransformer
java.lang.Object
org.tribuo.interop.tensorflow.RegressorTransformer
- 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
,OutputTransformer<Regressor>
Can convert a
Regressor
to a Tensor
containing a 32-bit float and a Tensor into a
Prediction
or Regressor.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Does this OutputTransformer generate probabilities.com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
toString()
org.tensorflow.Tensor
<?> Converts a list ofExample
into aTensor
representing all the outputs in the list.org.tensorflow.Tensor
<?> transform
(Regressor example, ImmutableOutputInfo<Regressor> outputIDInfo) Converts anOutput
into aTensor
representing it's output.transformToBatchOutput
(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Regressor> outputIDInfo) Converts aTensor
containing multiple outputs into a list ofOutput
s.transformToBatchPrediction
(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Regressor> outputIDInfo, int[] numValidFeatures, List<Example<Regressor>> examples) Converts aTensor
containing multiple outputs into a list ofPrediction
s.transformToOutput
(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Regressor> outputIDInfo) Converts aTensor
into the specified output type.transformToPrediction
(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Regressor> outputIDInfo, int numValidFeatures, Example<Regressor> example) Converts aTensor
into aPrediction
.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
-
RegressorTransformer
public RegressorTransformer()
-
-
Method Details
-
transformToPrediction
public Prediction<Regressor> transformToPrediction(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Regressor> outputIDInfo, int numValidFeatures, Example<Regressor> example) Description copied from interface:OutputTransformer
Converts aTensor
into aPrediction
.- Specified by:
transformToPrediction
in interfaceOutputTransformer<Regressor>
- Parameters:
tensor
- The tensor to convert.outputIDInfo
- The output info to use to identify the outputs.numValidFeatures
- The number of valid features used by the prediction.example
- The example to insert into the prediction.- Returns:
- A prediction object.
-
transformToOutput
public Regressor transformToOutput(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Regressor> outputIDInfo) Description copied from interface:OutputTransformer
Converts aTensor
into the specified output type.- Specified by:
transformToOutput
in interfaceOutputTransformer<Regressor>
- Parameters:
tensor
- The tensor to convert.outputIDInfo
- The output info to use to identify the outputs.- Returns:
- A output.
-
transformToBatchPrediction
public List<Prediction<Regressor>> transformToBatchPrediction(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Regressor> outputIDInfo, int[] numValidFeatures, List<Example<Regressor>> examples) Description copied from interface:OutputTransformer
Converts aTensor
containing multiple outputs into a list ofPrediction
s.- Specified by:
transformToBatchPrediction
in interfaceOutputTransformer<Regressor>
- Parameters:
tensor
- The tensor to convert.outputIDInfo
- The output info to use to identify the outputs.numValidFeatures
- The number of valid features used by the prediction.examples
- The example to insert into the prediction.- Returns:
- A list of predictions.
-
transformToBatchOutput
public List<Regressor> transformToBatchOutput(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Regressor> outputIDInfo) Description copied from interface:OutputTransformer
Converts aTensor
containing multiple outputs into a list ofOutput
s.- Specified by:
transformToBatchOutput
in interfaceOutputTransformer<Regressor>
- Parameters:
tensor
- The tensor to convert.outputIDInfo
- The output info to use to identify the outputs.- Returns:
- A list of outputs.
-
transform
public org.tensorflow.Tensor<?> transform(Regressor example, ImmutableOutputInfo<Regressor> outputIDInfo) Description copied from interface:OutputTransformer
Converts anOutput
into aTensor
representing it's output.- Specified by:
transform
in interfaceOutputTransformer<Regressor>
- Parameters:
example
- The output to convert.outputIDInfo
- The output info to use to identify the outputs.- Returns:
- A Tensor representing this output.
-
transform
public org.tensorflow.Tensor<?> transform(List<Example<Regressor>> examples, ImmutableOutputInfo<Regressor> outputIDInfo) Description copied from interface:OutputTransformer
Converts a list ofExample
into aTensor
representing all the outputs in the list. It accepts a list of Example rather than a list of Output for efficiency reasons.- Specified by:
transform
in interfaceOutputTransformer<Regressor>
- Parameters:
examples
- The examples to convert.outputIDInfo
- The output info to use to identify the outputs.- Returns:
- A Tensor representing all the supplied Outputs.
-
generatesProbabilities
Description copied from interface:OutputTransformer
Does this OutputTransformer generate probabilities.- Specified by:
generatesProbabilities
in interfaceOutputTransformer<Regressor>
- Returns:
- True if it produces a probability distribution in the
Prediction
.
-
toString
-
getProvenance
- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-