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 TypeMethodDescriptionbooleanDoes this OutputTransformer generate probabilities.com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenancetoString()org.tensorflow.Tensor<?> Converts a list ofExampleinto aTensorrepresenting all the outputs in the list.org.tensorflow.Tensor<?> transform(Regressor example, ImmutableOutputInfo<Regressor> outputIDInfo) Converts anOutputinto aTensorrepresenting it's output.transformToBatchOutput(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Regressor> outputIDInfo) Converts aTensorcontaining multiple outputs into a list ofOutputs.transformToBatchPrediction(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Regressor> outputIDInfo, int[] numValidFeatures, List<Example<Regressor>> examples) Converts aTensorcontaining multiple outputs into a list ofPredictions.transformToOutput(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Regressor> outputIDInfo) Converts aTensorinto the specified output type.transformToPrediction(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Regressor> outputIDInfo, int numValidFeatures, Example<Regressor> example) Converts aTensorinto aPrediction.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
-
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:OutputTransformerConverts aTensorinto aPrediction.- Specified by:
transformToPredictionin 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:OutputTransformerConverts aTensorinto the specified output type.- Specified by:
transformToOutputin 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:OutputTransformerConverts aTensorcontaining multiple outputs into a list ofPredictions.- Specified by:
transformToBatchPredictionin 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:OutputTransformerConverts aTensorcontaining multiple outputs into a list ofOutputs.- Specified by:
transformToBatchOutputin 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:OutputTransformerConverts anOutputinto aTensorrepresenting it's output.- Specified by:
transformin 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:OutputTransformerConverts a list ofExampleinto aTensorrepresenting all the outputs in the list. It accepts a list of Example rather than a list of Output for efficiency reasons.- Specified by:
transformin 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:OutputTransformerDoes this OutputTransformer generate probabilities.- Specified by:
generatesProbabilitiesin interfaceOutputTransformer<Regressor>- Returns:
- True if it produces a probability distribution in the
Prediction.
-
toString
-
getProvenance
- Specified by:
getProvenancein interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-