O
- Vector type@Reference(authors="D. Arthur, S. Vassilvitskii", title="k-means++: the advantages of careful seeding", booktitle="Proc. 18th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2007)", url="http://dl.acm.org/citation.cfm?id=1283383.1283494", bibkey="DBLP:conf/soda/ArthurV07") @Alias(value="de.lmu.ifi.dbs.elki.algorithm.clustering.kmeans.KMeansPlusPlusInitialMeans") public class KMeansPlusPlusInitialMeans<O> extends AbstractKMeansInitialization implements KMedoidsInitialization<O>
Reference:
D. Arthur, S. Vassilvitskii
k-means++: the advantages of careful seeding
Proc. 18th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2007)
Modifier and Type | Class and Description |
---|---|
static class |
KMeansPlusPlusInitialMeans.Parameterizer<V>
Parameterization class.
|
rnd
Constructor and Description |
---|
KMeansPlusPlusInitialMeans(RandomFactory rnd)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double[][] |
chooseInitialMeans(Database database,
Relation<? extends NumberVector> relation,
int k,
NumberVectorDistanceFunction<?> distanceFunction)
Choose initial means
|
DBIDs |
chooseInitialMedoids(int k,
DBIDs ids,
DistanceQuery<? super O> distQ)
Choose initial means
|
(package private) static void |
chooseRemaining(DBIDs ids,
DistanceQuery<?> distQ,
int k,
ArrayModifiableDBIDs means,
WritableDoubleDataStore weights,
double weightsum,
java.util.Random random)
Choose remaining means, weighted by distance.
|
(package private) static void |
chooseRemaining(Relation<? extends NumberVector> relation,
DBIDs ids,
DistanceQuery<NumberVector> distQ,
int k,
java.util.List<NumberVector> means,
WritableDoubleDataStore weights,
double weightsum,
java.util.Random random)
Choose remaining means, weighted by distance.
|
(package private) static double |
initialWeights(WritableDoubleDataStore weights,
DBIDs ids,
DBIDRef latest,
DistanceQuery<?> distQ)
Initialize the weight list.
|
(package private) static double |
initialWeights(WritableDoubleDataStore weights,
DBIDs ids,
NumberVector first,
DistanceQuery<? super NumberVector> distQ)
Initialize the weight list.
|
private static double |
updateWeights(WritableDoubleDataStore weights,
DBIDs ids,
DBIDRef latest,
DistanceQuery<?> distQ)
Update the weight list.
|
private static double |
updateWeights(WritableDoubleDataStore weights,
DBIDs ids,
NumberVector latest,
DistanceQuery<? super NumberVector> distQ)
Update the weight list.
|
unboxVectors
public KMeansPlusPlusInitialMeans(RandomFactory rnd)
rnd
- Random generator.public double[][] chooseInitialMeans(Database database, Relation<? extends NumberVector> relation, int k, NumberVectorDistanceFunction<?> distanceFunction)
KMeansInitialization
chooseInitialMeans
in interface KMeansInitialization
database
- Database contextrelation
- Relationk
- Parameter kdistanceFunction
- Distance functionpublic DBIDs chooseInitialMedoids(int k, DBIDs ids, DistanceQuery<? super O> distQ)
KMedoidsInitialization
chooseInitialMedoids
in interface KMedoidsInitialization<O>
k
- Parameter kids
- Candidate IDs.distQ
- Distance functionstatic double initialWeights(WritableDoubleDataStore weights, DBIDs ids, NumberVector first, DistanceQuery<? super NumberVector> distQ)
weights
- Weight listids
- IDsfirst
- Added IDdistQ
- Distance querystatic double initialWeights(WritableDoubleDataStore weights, DBIDs ids, DBIDRef latest, DistanceQuery<?> distQ)
weights
- Weight listids
- IDslatest
- Added IDdistQ
- Distance querystatic void chooseRemaining(Relation<? extends NumberVector> relation, DBIDs ids, DistanceQuery<NumberVector> distQ, int k, java.util.List<NumberVector> means, WritableDoubleDataStore weights, double weightsum, java.util.Random random)
relation
- Data relationids
- IDsdistQ
- Distance functionk
- Number of means to choosemeans
- Means storageweights
- Weights (initialized!)weightsum
- Sum of weightsrandom
- Random generatorstatic void chooseRemaining(DBIDs ids, DistanceQuery<?> distQ, int k, ArrayModifiableDBIDs means, WritableDoubleDataStore weights, double weightsum, java.util.Random random)
ids
- IDsdistQ
- Distance functionk
- Number of means to choosemeans
- Means storageweights
- Weights (initialized!)weightsum
- Sum of weightsrandom
- Random generatorprivate static double updateWeights(WritableDoubleDataStore weights, DBIDs ids, DBIDRef latest, DistanceQuery<?> distQ)
weights
- Weight listids
- IDslatest
- Added IDdistQ
- Distance queryprivate static double updateWeights(WritableDoubleDataStore weights, DBIDs ids, NumberVector latest, DistanceQuery<? super NumberVector> distQ)
weights
- Weight listids
- IDslatest
- Added IDdistQ
- Distance queryCopyright © 2019 ELKI Development Team. License information.