Class MultiLabelInfo
java.lang.Object
org.tribuo.multilabel.MultiLabelInfo
- All Implemented Interfaces:
Serializable,OutputInfo<MultiLabel>
- Direct Known Subclasses:
ImmutableMultiLabelInfo,MutableMultiLabelInfo
The base class for information about
MultiLabel outputs.- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionabstract MultiLabelInfocopy()Generates a copy of this OutputInfo, including it's mutability.Generates anImmutableOutputInfowhich has a copy of the data in thisOutputInfo, but also has id values and is immutable.Generates a mutable copy of thisOutputInfo.Returns a set of MultiLabel, where each has a single Label inside it.longgetLabelCount(String label) Get the number of times this String was observed, or 0 if unknown.longgetLabelCount(Label label) Get the number of times this Label was observed, or 0 if unknown.intReturns the number of unknownOutputinstances (generated byOutputFactory.getUnknownOutput()) that this OutputInfo has seen.An Iterable over the possible outputs and the number of times they were observed.intsize()Returns the number of possible values this OutputInfo knows about.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tribuo.OutputInfo
toReadableString
-
Field Details
-
labelCounts
-
unknownCount
-
labels
-
totalCount
-
-
Method Details
-
getUnknownCount
Description copied from interface:OutputInfoReturns the number of unknownOutputinstances (generated byOutputFactory.getUnknownOutput()) that this OutputInfo has seen.- Specified by:
getUnknownCountin interfaceOutputInfo<MultiLabel>- Returns:
- The number of unknown outputs observed.
-
getDomain
Returns a set of MultiLabel, where each has a single Label inside it. The set covers the space of Labels that this MultiLabelInfo has seen.- Specified by:
getDomainin interfaceOutputInfo<MultiLabel>- Returns:
- The set of possible labels.
-
getLabelCount
Get the number of times this Label was observed, or 0 if unknown.- Parameters:
label- The Label to look for.- Returns:
- A non-negative long.
-
getLabelCount
Get the number of times this String was observed, or 0 if unknown.- Parameters:
label- The String to look for.- Returns:
- A non-negative long.
-
outputCountsIterable
Description copied from interface:OutputInfoAn Iterable over the possible outputs and the number of times they were observed.Provides similar functionality to an iterator over the entrySet of a Map, though this is a copy of the data and immutable.
- Specified by:
outputCountsIterablein interfaceOutputInfo<MultiLabel>- Returns:
- Lambda wrapping an iterator over Pairs.
-
size
Description copied from interface:OutputInfoReturns the number of possible values this OutputInfo knows about.For real values this is the number of dimensions observed.
- Specified by:
sizein interfaceOutputInfo<MultiLabel>- Returns:
- An int representing the size of the domain.
-
generateImmutableOutputInfo
Description copied from interface:OutputInfoGenerates anImmutableOutputInfowhich has a copy of the data in thisOutputInfo, but also has id values and is immutable.- Specified by:
generateImmutableOutputInfoin interfaceOutputInfo<MultiLabel>- Returns:
- An immutable copy of this OutputInfo.
-
generateMutableOutputInfo
Description copied from interface:OutputInfoGenerates a mutable copy of thisOutputInfo.- Specified by:
generateMutableOutputInfoin interfaceOutputInfo<MultiLabel>- Returns:
- A mutable copy of this OutputInfo.
-
copy
Description copied from interface:OutputInfoGenerates a copy of this OutputInfo, including it's mutability.- Specified by:
copyin interfaceOutputInfo<MultiLabel>- Returns:
- A copy of the OutputInfo.
-