Class SampleKMeans<V extends NumberVector>
- java.lang.Object
-
- elki.clustering.kmeans.initialization.AbstractKMeansInitialization
-
- elki.clustering.kmeans.initialization.SampleKMeans<V>
-
- Type Parameters:
V
- Vector type
- All Implemented Interfaces:
KMeansInitialization
@Reference(authors="P. S. Bradley, U. M. Fayyad", title="Refining Initial Points for K-Means Clustering", booktitle="Proc. 15th Int. Conf. on Machine Learning (ICML 1998)", bibkey="DBLP:conf/icml/BradleyF98") public class SampleKMeans<V extends NumberVector> extends AbstractKMeansInitialization
Initialize k-means by running k-means on a sample of the data set only.Reference:
The idea of finding centers on a sample can be found in:
P. S. Bradley, U. M. Fayyad
Refining Initial Points for K-Means Clustering
Proc. 15th Int. Conf. on Machine Learning (ICML 1998)But Bradley and Fayyad also suggest to repeat this multiple times. This implementation uses a single attempt only.
- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private KMeans<V,?>
innerkMeans
Variant of kMeans to use for initialization.private double
rate
Sample size.-
Fields inherited from class elki.clustering.kmeans.initialization.AbstractKMeansInitialization
rnd
-
-
Constructor Summary
Constructors Constructor Description SampleKMeans(RandomFactory rnd, KMeans<V,?> innerkMeans, double rate)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[][]
chooseInitialMeans(Relation<? extends NumberVector> relation, int k, NumberVectorDistance<?> distance)
Choose initial means-
Methods inherited from class elki.clustering.kmeans.initialization.AbstractKMeansInitialization
unboxVectors
-
-
-
-
Field Detail
-
innerkMeans
private KMeans<V extends NumberVector,?> innerkMeans
Variant of kMeans to use for initialization.
-
rate
private double rate
Sample size.
-
-
Constructor Detail
-
SampleKMeans
public SampleKMeans(RandomFactory rnd, KMeans<V,?> innerkMeans, double rate)
Constructor.- Parameters:
rnd
- Random generator.innerkMeans
- Inner k-means algorithm.rate
- Sampling rate.
-
-
Method Detail
-
chooseInitialMeans
public double[][] chooseInitialMeans(Relation<? extends NumberVector> relation, int k, NumberVectorDistance<?> distance)
Description copied from interface:KMeansInitialization
Choose initial means- Parameters:
relation
- Relationk
- Parameter kdistance
- Distance function- Returns:
- List of chosen means for k-means
-
-