Package org.tribuo.impl
Class ModelDataCarrier<T extends Output<T>>
java.lang.Object
org.tribuo.impl.ModelDataCarrier<T>
Serialization carrier for common fields in Model and SequenceModel.
Likely to be a record one day.
-
Constructor Summary
ConstructorDescriptionModelDataCarrier
(String name, ModelProvenance provenance, ImmutableFeatureMap featureDomain, ImmutableOutputInfo<T> outputDomain, boolean generatesProbabilities, String tribuoVersion) Constructs a new ModelDataCarrier. -
Method Summary
Modifier and TypeMethodDescriptionstatic ModelDataCarrier<?>
deserialize
(org.tribuo.protos.core.ModelDataProto proto) Deserializes aModelDataProto
into aModelDataCarrier
.boolean
The feature domain.boolean
Does this model generate probabilities?int
hashCode()
name()
The model name.The output domain.The model provenance.org.tribuo.protos.core.ModelDataProto
Serializes this object to a protobuf.toString()
Gets the Tribuo version string.
-
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
The model name.- Returns:
- The model name.
-
provenance
The model provenance.- Returns:
- The model provenance.
-
featureDomain
The feature domain.- Returns:
- The feature domain.
-
outputDomain
The output domain.- Returns:
- The output domain.
-
generatesProbabilities
public boolean generatesProbabilities()Does this model generate probabilities?- Returns:
- Does the model generate probabilities?
-
tribuoVersion
Gets the Tribuo version string.- Returns:
- The Tribuo version string.
-
deserialize
Deserializes aModelDataProto
into aModelDataCarrier
.- 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
-
hashCode
public int hashCode() -
toString
-