Class ModelDataCarrier<T extends Output<T>>

java.lang.Object
org.tribuo.impl.ModelDataCarrier<T>

public final class ModelDataCarrier<T extends Output<T>> extends Object
Serialization carrier for common fields in Model and SequenceModel.

Likely to be a record one day.

  • Constructor Details

    • ModelDataCarrier

      public ModelDataCarrier(String name, ModelProvenance provenance, ImmutableFeatureMap featureDomain, ImmutableOutputInfo<T> outputDomain, boolean generatesProbabilities, String tribuoVersion)
      Constructs a new ModelDataCarrier.

      Will be the canonical constructor for the record form.

      Parameters:
      name - The model name.
      provenance - The model provenance.
      featureDomain - The feature domain.
      outputDomain - The output domain.
      generatesProbabilities - Does this model generate probabilities?
      tribuoVersion - The Tribuo version string.
  • Method Details

    • name

      public String name()
      The model name.
      Returns:
      The model name.
    • provenance

      public ModelProvenance provenance()
      The model provenance.
      Returns:
      The model provenance.
    • featureDomain

      public ImmutableFeatureMap featureDomain()
      The feature domain.
      Returns:
      The feature domain.
    • outputDomain

      public ImmutableOutputInfo<T> outputDomain()
      The output domain.
      Returns:
      The output domain.
    • generatesProbabilities

      public boolean generatesProbabilities()
      Does this model generate probabilities?
      Returns:
      Does the model generate probabilities?
    • tribuoVersion

      public String tribuoVersion()
      Gets the Tribuo version string.
      Returns:
      The Tribuo version string.
    • deserialize

      public static ModelDataCarrier<?> deserialize(org.tribuo.protos.core.ModelDataProto proto)
      Deserializes a ModelDataProto into a ModelDataCarrier.
      Parameters:
      proto - The proto to deserialize.
      Returns:
      The model data.
    • serialize

      public org.tribuo.protos.core.ModelDataProto serialize()
      Serializes this object to a protobuf.
      Returns:
      The protobuf representation.
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object