Package org.tribuo.classification
Class MutableLabelInfo
java.lang.Object
org.tribuo.classification.LabelInfo
org.tribuo.classification.MutableLabelInfo
- All Implemented Interfaces:
Serializable
,MutableOutputInfo<Label>
,OutputInfo<Label>
,ProtoSerializable<org.tribuo.protos.core.OutputDomainProto>
A mutable
LabelInfo
. Can record new observations of Labels, incrementing the
appropriate counts.- See Also:
-
Field Summary
Fields inherited from class org.tribuo.classification.LabelInfo
labelCounts, labels, unknownCount
Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
Constructor Summary
ConstructorDescriptionMutableLabelInfo
(LabelInfo info) Constructs a mutable deep copy of the supplied label info. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the OutputInfo, removing all things it's observed.copy()
Generates a copy of this OutputInfo, including it's mutability.static MutableLabelInfo
deserializeFromProto
(int version, String className, com.google.protobuf.Any message) Deserialization factory.boolean
int
hashCode()
void
Records an output value or statistics thereof.org.tribuo.protos.core.OutputDomainProto
Serializes this object to a protobuf.Generates a String form of this OutputInfo.toString()
Methods inherited from class org.tribuo.classification.LabelInfo
generateImmutableOutputInfo, generateMutableOutputInfo, getDomain, getLabelCount, getLabelCount, getUnknownCount, outputCountsIterable, size
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.tribuo.OutputInfo
generateImmutableOutputInfo, generateMutableOutputInfo, getDomain, getUnknownCount, outputCountsIterable, size
-
Constructor Details
-
MutableLabelInfo
Constructs a mutable deep copy of the supplied label info.- Parameters:
info
- The info to copy.
-
-
Method Details
-
deserializeFromProto
public static MutableLabelInfo deserializeFromProto(int version, String className, com.google.protobuf.Any message) throws com.google.protobuf.InvalidProtocolBufferException Deserialization factory.- Parameters:
version
- The serialized object version.className
- The class name.message
- The serialized data.- Returns:
- The deserialized object.
- Throws:
com.google.protobuf.InvalidProtocolBufferException
- If the protobuf could not be parsed from themessage
.
-
serialize
public org.tribuo.protos.core.OutputDomainProto serialize()Description copied from interface:ProtoSerializable
Serializes this object to a protobuf.- Specified by:
serialize
in interfaceProtoSerializable<org.tribuo.protos.core.OutputDomainProto>
- Returns:
- The protobuf.
-
observe
Description copied from interface:MutableOutputInfo
Records an output value or statistics thereof.- Specified by:
observe
in interfaceMutableOutputInfo<Label>
- Parameters:
output
- The observed output.
-
clear
public void clear()Description copied from interface:MutableOutputInfo
Clears the OutputInfo, removing all things it's observed.- Specified by:
clear
in interfaceMutableOutputInfo<Label>
-
copy
Description copied from interface:OutputInfo
Generates a copy of this OutputInfo, including it's mutability.- Specified by:
copy
in interfaceOutputInfo<Label>
- Specified by:
copy
in classLabelInfo
- Returns:
- A copy of the OutputInfo.
-
toReadableString
Description copied from interface:OutputInfo
Generates a String form of this OutputInfo.This String can contain newlines, tabs and other formatting.
- Specified by:
toReadableString
in interfaceOutputInfo<Label>
- Returns:
- A formatted String representing this OutputInfo.
-
toString
-
equals
-
hashCode
public int hashCode()
-