Package elki.clustering.kmeans
Class KDTreeFilteringKMeans.Instance
- java.lang.Object
-
- elki.clustering.kmeans.AbstractKMeans.Instance
-
- elki.clustering.kmeans.KDTreePruningKMeans.Instance
-
- elki.clustering.kmeans.KDTreeFilteringKMeans.Instance
-
- Enclosing class:
- KDTreeFilteringKMeans<V extends NumberVector>
protected class KDTreeFilteringKMeans.Instance extends KDTreePruningKMeans.Instance
Inner instance, storing state for a single data set.- Author:
- Cedrik Lüdicke, Erich Schubert
-
-
Field Summary
-
Fields inherited from class elki.clustering.kmeans.KDTreePruningKMeans.Instance
clusterSizes, clusterSums, indices, iter, root, sorted
-
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 Logging
getLogger()
Get the class logger.protected int
getNearestCenter(double[] mid, int alive)
Get the nearest (alive) center to a midpoint.protected boolean
isFarther(double[] z_star, double[] z, double[] mid, double[] halfwidth)
Check if a cluster mean is farther than another.protected int
pruning(KDTreePruningKMeans.KDNode u, int alive)
The pruning algorithm.-
Methods inherited from class elki.clustering.kmeans.KDTreePruningKMeans.Instance
buildTreeBoundedMidpoint, buildTreeMedian, buildTreeMidpoint, buildTreeSSQ, getMinMaxDist, iterate, labelSubtree, mindist, run, traversal, traverseLeaf
-
Methods inherited from class elki.clustering.kmeans.AbstractKMeans.Instance
assignToNearestCluster, buildResult, buildResult, computeSquaredSeparation, copyMeans, distance, distance, distance, initialSeperation, meansFromSums, movedDistance, recomputeSeperation, recomputeVariance, sqrtdistance, sqrtdistance, sqrtdistance
-
-
-
-
Constructor Detail
-
Instance
public Instance(Relation<? extends NumberVector> relation, NumberVectorDistance<?> df, double[][] means)
Constructor.- Parameters:
relation
- Relation of data pointsdf
- Distance functionmeans
- Initial means
-
-
Method Detail
-
pruning
protected int pruning(KDTreePruningKMeans.KDNode u, int alive)
Description copied from class:KDTreePruningKMeans.Instance
The pruning algorithm.- Overrides:
pruning
in classKDTreePruningKMeans.Instance
- Parameters:
u
- Current nodealive
- Range of alive means- Returns:
- Updated range.
-
getNearestCenter
protected int getNearestCenter(double[] mid, int alive)
Get the nearest (alive) center to a midpoint.- Parameters:
mid
- midpointalive
- Number of alive centers- Returns:
- best center
-
isFarther
protected boolean isFarther(double[] z_star, double[] z, double[] mid, double[] halfwidth)
Check if a cluster mean is farther than another. Optimized version of the comparison suggested by Kanungo.
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractKMeans.Instance
Get the class logger.- Overrides:
getLogger
in classKDTreePruningKMeans.Instance
- Returns:
- Logger
-
-