protected static class KMeansHamerly.Instance extends AbstractKMeans.Instance
| Modifier and Type | Field and Description |
|---|---|
(package private) WritableDoubleDataStore |
lower
Lower bounding distance
|
(package private) double[][] |
newmeans
Temporary storage for the new means.
|
(package private) double[] |
sep
Separation of means / distance moved.
|
(package private) double[][] |
sums
Sum aggregate for the new mean.
|
(package private) WritableDoubleDataStore |
upper
Upper bounding distance
|
assignment, clusters, isSquared, k, key, means, relation, varsum| Constructor and Description |
|---|
Instance(Relation<? extends NumberVector> relation,
NumberVectorDistanceFunction<?> df,
double[][] means)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
assignToNearestCluster()
Reassign objects, but avoid unnecessary computations based on their
bounds.
|
protected Logging |
getLogger()
Get the class logger.
|
protected int |
initialAssignToNearestCluster()
Perform initial cluster assignment.
|
protected int |
iterate(int iteration)
Main loop function.
|
protected void |
recomputeSeperation(double[][] means,
double[] sep)
Recompute the separation of cluster means.
|
protected void |
updateBounds(double[] move,
double delta)
Update the bounds for k-means.
|
buildResult, buildResult, copyMeans, distance, isSquared, meansFromSums, movedDistance, recomputeSeperation, rundouble[][] sums
double[][] newmeans
double[] sep
WritableDoubleDataStore upper
WritableDoubleDataStore lower
public Instance(Relation<? extends NumberVector> relation, NumberVectorDistanceFunction<?> df, double[][] means)
relation - Relationmeans - Initial meansprotected int iterate(int iteration)
AbstractKMeans.Instanceiterate in class AbstractKMeans.Instanceiteration - Iteration number (beginning at 1)protected int initialAssignToNearestCluster()
protected int assignToNearestCluster()
assignToNearestCluster in class AbstractKMeans.Instanceprotected void recomputeSeperation(double[][] means,
double[] sep)
Used by Hamerly.
means - Meanssep - Output array of separation (half-sqrt scaled)protected void updateBounds(double[] move,
double delta)
move - Movement of centersdelta - Maximum center movement.protected Logging getLogger()
AbstractKMeans.InstancegetLogger in class AbstractKMeans.InstanceCopyright © 2019 ELKI Development Team. License information.