Class OCIRegressorConverter

java.lang.Object
org.tribuo.interop.oci.OCIRegressorConverter
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<Regressor>, ProtoSerializable<org.tribuo.interop.oci.protos.OCIOutputConverterProto>

public final class OCIRegressorConverter extends Object implements OCIOutputConverter<Regressor>
A converter for DenseMatrix and DenseVector into Regressor Predictions.
See Also:
  • Field Details

    • CURRENT_VERSION

      public static final int CURRENT_VERSION
      Protobuf serialization version.
      See Also:
  • Constructor Details

    • OCIRegressorConverter

      public OCIRegressorConverter()
      Constructs an OCIRegressorConverter.
  • Method Details

    • deserializeFromProto

      public static OCIRegressorConverter deserializeFromProto(int version, String className, com.google.protobuf.Any message)
      Deserialization factory.
      Parameters:
      version - The serialized object version.
      className - The class name.
      message - The serialized data.
      Returns:
      The deserialized object.
    • convertOutput

      public Prediction<Regressor> convertOutput(DenseVector scores, int numValidFeature, Example<Regressor> example, ImmutableOutputInfo<Regressor> outputIDInfo)
      Description copied from interface: OCIOutputConverter
      Converts a dense vector into a single prediction of the appropriate type.
      Specified by:
      convertOutput in interface OCIOutputConverter<Regressor>
      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<Regressor>> convertOutput(DenseMatrix scores, int[] numValidFeatures, List<Example<Regressor>> examples, ImmutableOutputInfo<Regressor> outputIDInfo)
      Description copied from interface: OCIOutputConverter
      Converts a dense matrix into a list of predictions of the appropriate type.
      Specified by:
      convertOutput in interface OCIOutputConverter<Regressor>
      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 interface OCIOutputConverter<Regressor>
      Returns:
      True if it produces a probability distribution in the Prediction.
    • getTypeWitness

      public Class<Regressor> getTypeWitness()
      Description copied from interface: OCIOutputConverter
      The type witness used when deserializing the OCI model from a protobuf.

      The default implementation throws UnsupportedOperationException for compatibility with implementations which don't use protobuf serialization. This implementation will be removed in the next major version of Tribuo.

      Specified by:
      getTypeWitness in interface OCIOutputConverter<Regressor>
      Returns:
      The output class this object produces.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • serialize

      public org.tribuo.interop.oci.protos.OCIOutputConverterProto serialize()
      Description copied from interface: ProtoSerializable
      Serializes this object to a protobuf.
      Specified by:
      serialize in interface ProtoSerializable<org.tribuo.interop.oci.protos.OCIOutputConverterProto>
      Returns:
      The protobuf.
    • getProvenance

      public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
      Specified by:
      getProvenance in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>