Package org.tribuo.clustering
Class ClusteringInfo
java.lang.Object
org.tribuo.clustering.ClusteringInfo
- All Implemented Interfaces:
Serializable
,OutputInfo<ClusterID>
,ProtoSerializable<org.tribuo.protos.core.OutputDomainProto>
- Direct Known Subclasses:
ImmutableClusteringInfo
,MutableClusteringInfo
The base class for a ClusterID OutputInfo.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionThe cluster counts for each id.protected int
The number of times this object has seen the unknown cluster id.Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
Method Summary
Modifier and TypeMethodDescriptionabstract ClusteringInfo
copy()
Generates a copy of this OutputInfo, including it's mutability.boolean
Generates anImmutableOutputInfo
which has a copy of the data in thisOutputInfo
, but also has id values and is immutable.Generates a mutable copy of thisOutputInfo
.int
Returns the number of unknownOutput
instances (generated byOutputFactory.getUnknownOutput()
) that this OutputInfo has seen.int
hashCode()
An Iterable over the possible outputs and the number of times they were observed.org.tribuo.protos.core.OutputDomainProto
Serializes this object to a protobuf.int
size()
Returns the number of possible values this OutputInfo knows about.Generates a String form of this OutputInfo.toString()
-
Field Details
-
clusterCounts
The cluster counts for each id. -
unknownCount
protected int unknownCountThe number of times this object has seen the unknown cluster id.
-
-
Method Details
-
serialize
public org.tribuo.protos.core.OutputDomainProto serialize()Description copied from interface:ProtoSerializable
Serializes this object to a protobuf.- Specified by:
serialize
in interfaceProtoSerializable<org.tribuo.protos.core.OutputDomainProto>
- Returns:
- The protobuf.
-
getUnknownCount
public int getUnknownCount()Description copied from interface:OutputInfo
Returns the number of unknownOutput
instances (generated byOutputFactory.getUnknownOutput()
) that this OutputInfo has seen.- Specified by:
getUnknownCount
in interfaceOutputInfo<ClusterID>
- Returns:
- The number of unknown outputs observed.
-
getDomain
Description copied from interface:OutputInfo
Returns a set ofOutput
which represent the space of possible values theOutput
has taken.For real values this set represents the number of dimensions observed.
- Specified by:
getDomain
in interfaceOutputInfo<ClusterID>
- Returns:
- A Set of
T
.
-
size
public int size()Description copied from interface:OutputInfo
Returns the number of possible values this OutputInfo knows about.For real values this is the number of dimensions observed.
- Specified by:
size
in interfaceOutputInfo<ClusterID>
- Returns:
- An int representing the size of the domain.
-
generateImmutableOutputInfo
Description copied from interface:OutputInfo
Generates anImmutableOutputInfo
which has a copy of the data in thisOutputInfo
, but also has id values and is immutable.- Specified by:
generateImmutableOutputInfo
in interfaceOutputInfo<ClusterID>
- Returns:
- An immutable copy of this OutputInfo.
-
generateMutableOutputInfo
Description copied from interface:OutputInfo
Generates a mutable copy of thisOutputInfo
.- Specified by:
generateMutableOutputInfo
in interfaceOutputInfo<ClusterID>
- Returns:
- A mutable copy of this OutputInfo.
-
copy
Description copied from interface:OutputInfo
Generates a copy of this OutputInfo, including it's mutability.- Specified by:
copy
in interfaceOutputInfo<ClusterID>
- Returns:
- A copy of the OutputInfo.
-
outputCountsIterable
Description copied from interface:OutputInfo
An Iterable over the possible outputs and the number of times they were observed.Provides similar functionality to an iterator over the entrySet of a Map, though this is a copy of the data and immutable.
- Specified by:
outputCountsIterable
in interfaceOutputInfo<ClusterID>
- Returns:
- Lambda wrapping an iterator over Pairs.
-
toReadableString
Description copied from interface:OutputInfo
Generates a String form of this OutputInfo.This String can contain newlines, tabs and other formatting.
- Specified by:
toReadableString
in interfaceOutputInfo<ClusterID>
- Returns:
- A formatted String representing this OutputInfo.
-
toString
-
equals
-
hashCode
public int hashCode()
-