Package org.tribuo.multilabel
Class MutableMultiLabelInfo
java.lang.Object
org.tribuo.multilabel.MultiLabelInfo
org.tribuo.multilabel.MutableMultiLabelInfo
- All Implemented Interfaces:
Serializable
,MutableOutputInfo<MultiLabel>
,OutputInfo<MultiLabel>
,ProtoSerializable<org.tribuo.protos.core.OutputDomainProto>
A MutableOutputInfo for working with multi-label tasks.
- See Also:
-
Field Summary
Fields inherited from class org.tribuo.multilabel.MultiLabelInfo
labelCounts, labels, totalCount, unknownCount
Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
Constructor Summary
ConstructorDescriptionConstruct a MutableMultiLabelInfo with it's state copied from another MultiLabelInfo. -
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 MutableMultiLabelInfo
deserializeFromProto
(int version, String className, com.google.protobuf.Any message) Deserialization factory.void
observe
(MultiLabel output) Throws IllegalStateException if the MultiLabel contains a Label which has a "," in it.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.multilabel.MultiLabelInfo
equals, generateImmutableOutputInfo, generateMutableOutputInfo, getDomain, getLabelCount, getLabelCount, getUnknownCount, hashCode, 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
-
MutableMultiLabelInfo
Construct a MutableMultiLabelInfo with it's state copied from another MultiLabelInfo.- Parameters:
info
- The info to copy.
-
-
Method Details
-
deserializeFromProto
public static MutableMultiLabelInfo 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
Throws IllegalStateException if the MultiLabel contains a Label which has a "," in it.Such labels are disallowed. There should be an exception thrown when one is constructed too.
- Specified by:
observe
in interfaceMutableOutputInfo<MultiLabel>
- 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<MultiLabel>
-
copy
Description copied from interface:OutputInfo
Generates a copy of this OutputInfo, including it's mutability.- Specified by:
copy
in interfaceOutputInfo<MultiLabel>
- Specified by:
copy
in classMultiLabelInfo
- 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<MultiLabel>
- Returns:
- A formatted String representing this OutputInfo.
-
toString
-