Package elki.clustering.kmeans
Class SimplifiedElkanKMeans.Instance
- java.lang.Object
-
- elki.clustering.kmeans.AbstractKMeans.Instance
-
- elki.clustering.kmeans.SimplifiedElkanKMeans.Instance
-
- Direct Known Subclasses:
ElkanKMeans.Instance
- Enclosing class:
- SimplifiedElkanKMeans<V extends NumberVector>
protected static class SimplifiedElkanKMeans.Instance extends AbstractKMeans.Instance
Inner instance, storing state for a single data set.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) WritableDataStore<double[]>
lower
Lower bounds(package private) double[][]
newmeans
Scratch space for new means.(package private) double[]
sep
Cluster separation(package private) double[][]
sums
Sum aggregate for the new mean.(package private) WritableDoubleDataStore
upper
Upper bounds-
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 int
iterate(int iteration)
Main loop function.protected void
updateBounds(double[] move)
Update the bounds for k-means.-
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
-
sums
double[][] sums
Sum aggregate for the new mean.
-
newmeans
double[][] newmeans
Scratch space for new means.
-
upper
WritableDoubleDataStore upper
Upper bounds
-
lower
WritableDataStore<double[]> lower
Lower bounds
-
sep
double[] sep
Cluster separation
-
-
Constructor Detail
-
Instance
public Instance(Relation<? extends NumberVector> relation, NumberVectorDistance<?> df, double[][] means)
Constructor.- Parameters:
relation
- Relationdf
- Distance functionmeans
- Initial means
-
-
Method Detail
-
iterate
protected int iterate(int iteration)
Description copied from class:AbstractKMeans.Instance
Main loop function.- Specified by:
iterate
in classAbstractKMeans.Instance
- Parameters:
iteration
- Iteration number (beginning at 1)- Returns:
- Number of reassigned points
-
initialAssignToNearestCluster
protected int initialAssignToNearestCluster()
Perform initial cluster assignment.- Returns:
- Number of changes (i.e., relation size)
-
assignToNearestCluster
protected int assignToNearestCluster()
Description copied from class:AbstractKMeans.Instance
Assign each object to the nearest cluster.- Overrides:
assignToNearestCluster
in classAbstractKMeans.Instance
- Returns:
- number of objects reassigned
-
updateBounds
protected void updateBounds(double[] move)
Update the bounds for k-means.- Parameters:
move
- Movement of centers
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractKMeans.Instance
Get the class logger.- Specified by:
getLogger
in classAbstractKMeans.Instance
- Returns:
- Logger
-
-