Package org.tribuo
Interface ImmutableOutputInfo<T extends Output<T>>
- All Superinterfaces:
Iterable<com.oracle.labs.mlrg.olcut.util.Pair<Integer,
,T>> OutputInfo<T>
,Serializable
- All Known Implementing Classes:
ImmutableAnomalyInfo
,ImmutableClusteringInfo
,ImmutableLabelInfo
,ImmutableMultiLabelInfo
,ImmutableRegressionInfo
public interface ImmutableOutputInfo<T extends Output<T>>
extends OutputInfo<T>, Iterable<com.oracle.labs.mlrg.olcut.util.Pair<Integer,T>>
An
OutputInfo
that is fixed, and contains an id number for each valid output.
In the case of real valued outputs, the id number represents the dimension.
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
domainAndIDEquals
(ImmutableOutputInfo<T> other) Checks if the domain is the same as the other output info's domain, and that each element is mapped to the same id number.int
Return the id number associated with this output, or -1 if the output is unknown.getOutput
(int id) Returns the output associated with this id, or null if the id is unknown.long
Returns the total number of observed outputs seen by this ImmutableOutputInfo.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.tribuo.OutputInfo
copy, generateImmutableOutputInfo, generateMutableOutputInfo, getDomain, getUnknownCount, outputCountsIterable, size, toReadableString
-
Method Details
-
getID
Return the id number associated with this output, or -1 if the output is unknown.- Parameters:
output
- An output- Returns:
- A non-negative integer if the output is known, or -1 if the output is unknown.
-
getOutput
Returns the output associated with this id, or null if the id is unknown.- Parameters:
id
- A non-negative integer.- Returns:
- An output object or null if it's unknown.
-
getTotalObservations
long getTotalObservations()Returns the total number of observed outputs seen by this ImmutableOutputInfo.- Returns:
- The number of observed outputs.
-
domainAndIDEquals
Checks if the domain is the same as the other output info's domain, and that each element is mapped to the same id number.Note the default behaviour will be removed in a future major release, and should be overridden for performance reasons in all implementing classes.
- Parameters:
other
- The output info to compare.- Returns:
- True if the domains and ids are the same.
-