Package elki.clustering.kmeans
Class AnnulusKMeans.Instance
- java.lang.Object
-
- elki.clustering.kmeans.AbstractKMeans.Instance
-
- elki.clustering.kmeans.HamerlyKMeans.Instance
-
- elki.clustering.kmeans.AnnulusKMeans.Instance
-
- Enclosing class:
- AnnulusKMeans<V extends NumberVector>
protected static class AnnulusKMeans.Instance extends HamerlyKMeans.Instance
Inner instance, storing state for a single data set.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) double[]
cdist
Cluster center distances.(package private) int[]
cnum
Sorted neighbors(package private) WritableIntegerDataStore
second
Second nearest cluster.-
Fields inherited from class elki.clustering.kmeans.HamerlyKMeans.Instance
lower, newmeans, sep, sums, upper
-
Fields inherited from class elki.clustering.kmeans.AbstractKMeans.Instance
assignment, clusters, diststat, isSquared, k, key, means, relation, varsum
-
-
Constructor Summary
Constructors Constructor Description Instance(Relation<? extends NumberVector> relation, NumberVectorDistance<?> df, double[][] means)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
assignToNearestCluster()
Assign each object to the nearest cluster.protected Logging
getLogger()
Get the class logger.protected int
initialAssignToNearestCluster()
Perform initial cluster assignment.protected void
orderMeans()
Recompute the separation of cluster means.-
Methods inherited from class elki.clustering.kmeans.HamerlyKMeans.Instance
iterate, recomputeSeperation, updateBounds
-
Methods inherited from class elki.clustering.kmeans.AbstractKMeans.Instance
buildResult, buildResult, computeSquaredSeparation, copyMeans, distance, distance, distance, initialSeperation, meansFromSums, movedDistance, recomputeSeperation, recomputeVariance, run, sqrtdistance, sqrtdistance, sqrtdistance
-
-
-
-
Field Detail
-
second
WritableIntegerDataStore second
Second nearest cluster.
-
cdist
double[] cdist
Cluster center distances.
-
cnum
int[] cnum
Sorted neighbors
-
-
Constructor Detail
-
Instance
public Instance(Relation<? extends NumberVector> relation, NumberVectorDistance<?> df, double[][] means)
Constructor.- Parameters:
relation
- Relationdf
- Distance functionmeans
- Initial means
-
-
Method Detail
-
initialAssignToNearestCluster
protected int initialAssignToNearestCluster()
Description copied from class:HamerlyKMeans.Instance
Perform initial cluster assignment.- Overrides:
initialAssignToNearestCluster
in classHamerlyKMeans.Instance
- Returns:
- Number of changes (i.e., relation size)
-
orderMeans
protected void orderMeans()
Recompute the separation of cluster means.
-
assignToNearestCluster
protected int assignToNearestCluster()
Description copied from class:AbstractKMeans.Instance
Assign each object to the nearest cluster.- Overrides:
assignToNearestCluster
in classHamerlyKMeans.Instance
- Returns:
- number of objects reassigned
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractKMeans.Instance
Get the class logger.- Overrides:
getLogger
in classHamerlyKMeans.Instance
- Returns:
- Logger
-
-