public abstract class LabelInfo extends Object implements OutputInfo<Label>
Modifier and Type | Field and Description |
---|---|
protected Map<String,com.oracle.labs.mlrg.olcut.util.MutableLong> |
labelCounts
The occurrence counts of each label.
|
protected Map<String,Label> |
labels
The label domain.
|
protected int |
unknownCount
The number of unknown labels this LabelInfo has seen.
|
Modifier and Type | Method and Description |
---|---|
abstract LabelInfo |
copy()
Generates a copy of this OutputInfo, including it's mutability.
|
ImmutableOutputInfo<Label> |
generateImmutableOutputInfo()
Generates an
ImmutableOutputInfo which has a copy of the data
in this OutputInfo , but also has id values and is immutable. |
MutableOutputInfo<Label> |
generateMutableOutputInfo()
Generates a mutable copy of this
OutputInfo . |
Set<Label> |
getDomain()
Returns the set of possible
Label s that this LabelInfo has seen. |
long |
getLabelCount(Label label)
Gets the count of the supplied label, or 0 if the label is unknown.
|
long |
getLabelCount(String label)
Gets the count of the supplied label, or 0 if the label is unknown.
|
int |
getUnknownCount()
Returns the number of unknown
Output instances (generated by OutputFactory.getUnknownOutput() )
that this OutputInfo has seen. |
Iterable<com.oracle.labs.mlrg.olcut.util.Pair<String,Long>> |
outputCountsIterable()
An Iterable over the possible outputs and the number of times they were observed.
|
int |
size()
The number of unique
Label s this LabelInfo has seen. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toReadableString
protected final Map<String,com.oracle.labs.mlrg.olcut.util.MutableLong> labelCounts
protected int unknownCount
public int getUnknownCount()
OutputInfo
Output
instances (generated by OutputFactory.getUnknownOutput()
)
that this OutputInfo has seen.getUnknownCount
in interface OutputInfo<Label>
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>
public long getLabelCount(Label label)
label
- A Label.public long getLabelCount(String label)
label
- A String representing a Label.public Iterable<com.oracle.labs.mlrg.olcut.util.Pair<String,Long>> outputCountsIterable()
OutputInfo
Provides similar functionality to an iterator over the entrySet of a Map, though this is a copy of the data and immutable.
outputCountsIterable
in interface OutputInfo<Label>
public int size()
Label
s this LabelInfo has seen.size
in interface OutputInfo<Label>
public ImmutableOutputInfo<Label> generateImmutableOutputInfo()
OutputInfo
ImmutableOutputInfo
which has a copy of the data
in this OutputInfo
, but also has id values and is immutable.generateImmutableOutputInfo
in interface OutputInfo<Label>
public MutableOutputInfo<Label> generateMutableOutputInfo()
OutputInfo
OutputInfo
.generateMutableOutputInfo
in interface OutputInfo<Label>
public abstract LabelInfo copy()
OutputInfo
copy
in interface OutputInfo<Label>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.