Package org.tribuo.classification
Class LabelInfo
java.lang.Object
org.tribuo.classification.LabelInfo
- All Implemented Interfaces:
Serializable,OutputInfo<Label>
- Direct Known Subclasses:
ImmutableLabelInfo,MutableLabelInfo
The base class for information about multi-class classification Labels.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe occurrence counts of each label.The label domain.protected intThe number of unknown labels this LabelInfo has seen. -
Method Summary
Modifier and TypeMethodDescriptionabstract LabelInfocopy()Returns the set of possibleLabels that this LabelInfo has seen.longgetLabelCount(String label) Gets the count of the supplied label, or 0 if the label is unknown.longgetLabelCount(Label label) Gets the count of the supplied label, or 0 if the label is unknown.intintsize()The number of uniqueLabels this LabelInfo has seen.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
The occurrence counts of each label. -
unknownCount
The number of unknown labels this LabelInfo has seen. -
labels
The label domain.
-
-
Method Details
-
getUnknownCount
- Specified by:
getUnknownCountin interfaceOutputInfo<Label>
-
getDomain
Returns the set of possibleLabels that this LabelInfo has seen.Each label has the default score of Double.NaN.
- Specified by:
getDomainin interfaceOutputInfo<Label>- Returns:
- The set of possible labels.
-
getLabelCount
Gets the count of the supplied label, or 0 if the label is unknown.- Parameters:
label- A Label.- Returns:
- A non-negative long.
-
getLabelCount
Gets the count of the supplied label, or 0 if the label is unknown.- Parameters:
label- A String representing a Label.- Returns:
- A non-negative long.
-
outputCountsIterable
- Specified by:
outputCountsIterablein interfaceOutputInfo<Label>
-
size
The number of uniqueLabels this LabelInfo has seen.- Specified by:
sizein interfaceOutputInfo<Label>- Returns:
- The number of unique labels.
-
generateImmutableOutputInfo
- Specified by:
generateImmutableOutputInfoin interfaceOutputInfo<Label>
-
generateMutableOutputInfo
- Specified by:
generateMutableOutputInfoin interfaceOutputInfo<Label>
-
copy
- Specified by:
copyin interfaceOutputInfo<Label>
-