Package org.tribuo.classification
Class ImmutableLabelInfo
java.lang.Object
org.tribuo.classification.LabelInfo
org.tribuo.classification.ImmutableLabelInfo
- All Implemented Interfaces:
Serializable,Iterable<com.oracle.labs.mlrg.olcut.util.Pair<Integer,,Label>> ImmutableOutputInfo<Label>,OutputInfo<Label>
An
ImmutableOutputInfo object for Labels.
Gives each unique label an id number. Also counts each label occurrence like MutableLabelInfo does,
though the counts are frozen in this object.
- See Also:
-
Field Summary
Fields inherited from class org.tribuo.classification.LabelInfo
labelCounts, labels, unknownCount -
Method Summary
Methods inherited from class org.tribuo.classification.LabelInfo
generateImmutableOutputInfo, generateMutableOutputInfo, getLabelCount, getLabelCount, getUnknownCount, outputCountsIterable, sizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.tribuo.OutputInfo
generateImmutableOutputInfo, generateMutableOutputInfo, getUnknownCount, outputCountsIterable, size
-
Method Details
-
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>- Overrides:
getDomainin classLabelInfo- Returns:
- The set of possible labels.
-
getID
- Specified by:
getIDin interfaceImmutableOutputInfo<Label>
-
getOutput
- Specified by:
getOutputin interfaceImmutableOutputInfo<Label>
-
getTotalObservations
- Specified by:
getTotalObservationsin interfaceImmutableOutputInfo<Label>
-
getLabelCount
Returns the number of times the supplied id was observed before this LabelInfo was frozen.- Parameters:
id- The id number.- Returns:
- The count.
-
copy
- Specified by:
copyin interfaceOutputInfo<Label>- Specified by:
copyin classLabelInfo
-
toReadableString
- Specified by:
toReadableStringin interfaceOutputInfo<Label>
-
toString
-
iterator
-
domainAndIDEquals
- Specified by:
domainAndIDEqualsin interfaceImmutableOutputInfo<Label>
-