Class ImmutableClusteringInfo
java.lang.Object
org.tribuo.clustering.ClusteringInfo
org.tribuo.clustering.ImmutableClusteringInfo
- All Implemented Interfaces:
Serializable,Iterable<com.oracle.labs.mlrg.olcut.util.Pair<Integer, ClusterID>>,ImmutableOutputInfo<ClusterID>,OutputInfo<ClusterID>
public class ImmutableClusteringInfo
extends ClusteringInfo
implements ImmutableOutputInfo<ClusterID>
An
ImmutableOutputInfo object for ClusterIDs.
Gives each unique cluster an id number. Also counts each id occurrence like MutableClusteringInfo does,
though the counts are frozen in this object.
- See Also:
-
Field Summary
Fields inherited from class org.tribuo.clustering.ClusteringInfo
clusterCounts, unknownCount -
Constructor Summary
ConstructorsConstructorDescriptionImmutableClusteringInfo(Map<Integer, com.oracle.labs.mlrg.olcut.util.MutableLong> counts) -
Method Summary
Modifier and TypeMethodDescriptioncopy()Generates a copy of this OutputInfo, including it's mutability.intReturn 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.longReturns the total number of observed outputs seen by this ImmutableOutputInfo.iterator()Methods inherited from class org.tribuo.clustering.ClusteringInfo
generateImmutableOutputInfo, generateMutableOutputInfo, getUnknownCount, outputCountsIterable, size, toReadableStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.tribuo.OutputInfo
generateImmutableOutputInfo, generateMutableOutputInfo, getUnknownCount, outputCountsIterable, size, toReadableString
-
Constructor Details
-
ImmutableClusteringInfo
-
ImmutableClusteringInfo
-
-
Method Details
-
getDomain
Description copied from interface:OutputInfoReturns a set ofOutputwhich represent the space of possible values theOutputhas taken.For real values this set represents the number of dimensions observed.
- Specified by:
getDomainin interfaceOutputInfo<ClusterID>- Overrides:
getDomainin classClusteringInfo- Returns:
- A Set of
T.
-
getID
Description copied from interface:ImmutableOutputInfoReturn the id number associated with this output, or -1 if the output is unknown.- Specified by:
getIDin interfaceImmutableOutputInfo<ClusterID>- Parameters:
output- An output- Returns:
- A non-negative integer if the output is known, or -1 if the output is unknown.
-
getOutput
Description copied from interface:ImmutableOutputInfoReturns the output associated with this id, or null if the id is unknown.- Specified by:
getOutputin interfaceImmutableOutputInfo<ClusterID>- Parameters:
id- A non-negative integer.- Returns:
- An output object or null if it's unknown.
-
getTotalObservations
Description copied from interface:ImmutableOutputInfoReturns the total number of observed outputs seen by this ImmutableOutputInfo.- Specified by:
getTotalObservationsin interfaceImmutableOutputInfo<ClusterID>- Returns:
- The number of observed outputs.
-
copy
Description copied from interface:OutputInfoGenerates a copy of this OutputInfo, including it's mutability.- Specified by:
copyin interfaceOutputInfo<ClusterID>- Specified by:
copyin classClusteringInfo- Returns:
- A copy of the OutputInfo.
-
iterator
-