V
- Vector typeD
- Distance type@Reference(authors="D. Arthur, S. Vassilvitskii", title="k-means++: the advantages of careful seeding", booktitle="Proc. of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2007", url="http://dx.doi.org/10.1145/1283383.1283494") public class KMeansPlusPlusInitialMeans<V,D extends NumberDistance<D,?>> extends AbstractKMeansInitialization<V> implements KMedoidsInitialization<V>
D. Arthur, S. Vassilvitskii
k-means++: the advantages of careful seeding
In: Proc. of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms,
SODA 2007
Modifier and Type | Class and Description |
---|---|
static class |
KMeansPlusPlusInitialMeans.Parameterizer<V,D extends NumberDistance<D,?>>
Parameterization class.
|
rnd
Constructor and Description |
---|
KMeansPlusPlusInitialMeans(RandomFactory rnd)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
List<V> |
chooseInitialMeans(Relation<V> relation,
int k,
PrimitiveDistanceFunction<? super V,?> distanceFunction)
Choose initial means
|
DBIDs |
chooseInitialMedoids(int k,
DistanceQuery<? super V,?> distQ2)
Choose initial means
|
protected double |
initialWeights(double[] weights,
ArrayDBIDs ids,
DBID latest,
DistanceQuery<? super V,D> distQ)
Initialize the weight list.
|
protected double |
updateWeights(double[] weights,
ArrayDBIDs ids,
DBID latest,
DistanceQuery<? super V,D> distQ)
Update the weight list.
|
protected double |
updateWeights(double[] weights,
ArrayDBIDs ids,
DBID latest,
PrimitiveDoubleDistanceFunction<V> distF,
Relation<V> rel)
Update the weight list.
|
public KMeansPlusPlusInitialMeans(RandomFactory rnd)
rnd
- Random generator.public List<V> chooseInitialMeans(Relation<V> relation, int k, PrimitiveDistanceFunction<? super V,?> distanceFunction)
KMeansInitialization
chooseInitialMeans
in interface KMeansInitialization<V>
relation
- Relationk
- Parameter kdistanceFunction
- Distance functionpublic DBIDs chooseInitialMedoids(int k, DistanceQuery<? super V,?> distQ2)
KMedoidsInitialization
chooseInitialMedoids
in interface KMedoidsInitialization<V>
k
- Parameter kdistQ2
- Distance functionprotected double initialWeights(double[] weights, ArrayDBIDs ids, DBID latest, DistanceQuery<? super V,D> distQ)
weights
- Weight listids
- IDslatest
- Added IDdistQ
- Distance queryprotected double updateWeights(double[] weights, ArrayDBIDs ids, DBID latest, DistanceQuery<? super V,D> distQ)
weights
- Weight listids
- IDslatest
- Added IDdistQ
- Distance queryprotected double updateWeights(double[] weights, ArrayDBIDs ids, DBID latest, PrimitiveDoubleDistanceFunction<V> distF, Relation<V> rel)
weights
- Weight listids
- IDslatest
- Added IDdistF
- Distance function