V
- Vector typepublic class SampleKMeansInitialization<V extends NumberVector<?>,D extends Distance<?>> extends AbstractKMeansInitialization<V>
Modifier and Type | Class and Description |
---|---|
static class |
SampleKMeansInitialization.Parameterizer<V extends NumberVector<?>,D extends Distance<?>>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private KMeans<V,D,?> |
innerkMeans
Variant of kMeans for the bisecting step.
|
private double |
rate
Sample size.
|
rnd
Constructor and Description |
---|
SampleKMeansInitialization(RandomFactory rnd,
KMeans<V,D,?> innerkMeans,
double rate)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
List<V> |
chooseInitialMeans(Database database,
Relation<V> relation,
int k,
PrimitiveDistanceFunction<? super NumberVector<?>,?> distanceFunction)
Choose initial means
|
private KMeans<V extends NumberVector<?>,D extends Distance<?>,?> innerkMeans
private double rate
public SampleKMeansInitialization(RandomFactory rnd, KMeans<V,D,?> innerkMeans, double rate)
rnd
- Random generator.innerkMeans
- Inner k-means algorithm.rate
- Sampling rate.public List<V> chooseInitialMeans(Database database, Relation<V> relation, int k, PrimitiveDistanceFunction<? super NumberVector<?>,?> distanceFunction)
KMeansInitialization
database
- Database contextrelation
- Relationk
- Parameter kdistanceFunction
- Distance function