public class ImmutableLabelInfo extends LabelInfo implements ImmutableOutputInfo<Label>
Gives each unique label an id number. Also counts each label occurrence like MutableLabelInfo
does,
though the counts are frozen in this object.
labelCounts, labels, unknownCount
Modifier and Type | Method and Description |
---|---|
ImmutableLabelInfo |
copy()
Generates a copy of this OutputInfo, including it's mutability.
|
Set<Label> |
getDomain()
Returns the set of possible
Label s that this LabelInfo has seen. |
int |
getID(Label output)
Return the id number associated with this output, or -1 if the output is unknown.
|
long |
getLabelCount(int id)
Returns the number of times the supplied id was observed before this LabelInfo was frozen.
|
Label |
getOutput(int id)
Returns the output associated with this id, or null if the id is unknown.
|
long |
getTotalObservations()
Returns the total number of observed outputs seen by this ImmutableOutputInfo.
|
Iterator<com.oracle.labs.mlrg.olcut.util.Pair<Integer,Label>> |
iterator() |
String |
toReadableString()
Generates a String form of this OutputInfo.
|
String |
toString() |
generateImmutableOutputInfo, generateMutableOutputInfo, getLabelCount, getLabelCount, getUnknownCount, outputCountsIterable, size
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
generateImmutableOutputInfo, generateMutableOutputInfo, getUnknownCount, outputCountsIterable, size
forEach, spliterator
public Set<Label> getDomain()
Label
s that this LabelInfo has seen.
Each label has the default score of Double.NaN.getDomain
in interface OutputInfo<Label>
getDomain
in class LabelInfo
public int getID(Label output)
ImmutableOutputInfo
getID
in interface ImmutableOutputInfo<Label>
output
- An outputpublic Label getOutput(int id)
ImmutableOutputInfo
getOutput
in interface ImmutableOutputInfo<Label>
id
- A non-negative integer.public long getTotalObservations()
ImmutableOutputInfo
getTotalObservations
in interface ImmutableOutputInfo<Label>
public long getLabelCount(int id)
id
- The id number.public ImmutableLabelInfo copy()
OutputInfo
copy
in interface OutputInfo<Label>
copy
in class LabelInfo
public String toReadableString()
OutputInfo
This String can contain newlines, tabs and other formatting.
toReadableString
in interface OutputInfo<Label>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.