Package org.tribuo
Interface Output<T extends Output<T>>
- All Superinterfaces:
ProtoSerializable<org.tribuo.protos.core.OutputProto>
,Serializable
- All Known Subinterfaces:
Classifiable<T>
- All Known Implementing Classes:
ClusterID
,Event
,Label
,MultiLabel
,Regressor
,Regressor.DimensionTuple
public interface Output<T extends Output<T>>
extends ProtoSerializable<org.tribuo.protos.core.OutputProto>, Serializable
Output is the root interface for the supported prediction types.
It's subclassed in each of the modules:
- Label for multi-class classification
- MultiLabel for multi-label classification
- ClusterID for clustering
- Regressor for regression
- Event for anomaly detection
fullEquals(T)
.-
Field Summary
Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Deep copy of the output up to its immutable state.static Output<?>
deserialize
(org.tribuo.protos.core.OutputProto proto) Deserializes aOutputProto
into aOutput
subclass.boolean
fullEquals
(T other) Compares other to this output.default boolean
fullEquals
(T other, double tolerance) Compares other to this output.getSerializableForm
(boolean includeConfidence) Generates a String suitable for writing to a csv or json file.Methods inherited from interface org.tribuo.protos.ProtoSerializable
serialize
-
Method Details
-
copy
T copy()Deep copy of the output up to its immutable state.- Returns:
- A copy of the output.
-
getSerializableForm
Generates a String suitable for writing to a csv or json file.- Parameters:
includeConfidence
- Include whatever confidence score the label contains, if known.- Returns:
- A String representation of this Output.
-
fullEquals
Compares other to this output. Uses all score values and the strings.- Parameters:
other
- Another output instance.- Returns:
- True if the other instance has value equality to this instance. False otherwise.
-
fullEquals
Compares other to this output. Uses all score values and the strings.The default implementation of this method ignores the tolerance for compatibility reasons, it is overridden in all output classes in Tribuo.
- Parameters:
other
- Another output instance.tolerance
- The tolerance level for an absolute value comparison.- Returns:
- True if the other instance has value equality to this instance. False otherwise.
-
deserialize
Deserializes aOutputProto
into aOutput
subclass.- Parameters:
proto
- The proto to deserialize.- Returns:
- The deserialized Output.
-