O
- Object type for KMedoids initialization@Reference(authors="Erich Schubert, Peter J. Rousseeuw", title="Faster k-Medoids Clustering: Improving the PAM, CLARA, and CLARANS Algorithms", booktitle="preprint, to appear", url="https://arxiv.org/abs/1810.05691", bibkey="DBLP:journals/corr/abs-1810-05691") public class LABInitialMeans<O> extends java.lang.Object implements KMeansInitialization, KMedoidsInitialization<O>
This is a O(nk) aproximation of the original PAM BUILD. For performance, it uses an O(sqrt(n)) sample to achieve linear run time. The results will be worse than those of BUILD, but provide a good starting point for FastPAM optimization.
Reference:
Erich Schubert, Peter J. Rousseeuw
Faster k-Medoids Clustering:
Improving the PAM, CLARA, and CLARANS Algorithms
preprint, to appear
Modifier and Type | Class and Description |
---|---|
static class |
LABInitialMeans.Parameterizer<V>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private static Logging |
LOG
Class logger.
|
private RandomFactory |
rnd
Random generator
|
Constructor and Description |
---|
LABInitialMeans(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
|
protected static double |
getMinDist(DBIDArrayIter j,
DistanceQuery<?> distQ,
DBIDArrayIter mi,
WritableDoubleDataStore mindist)
Get the minimum distance to previous medoids.
|
private static void |
shuffle(ArrayModifiableDBIDs ids,
int ssize,
int end,
java.util.Random random)
Partial Fisher-Yates shuffle.
|
private static final Logging LOG
private RandomFactory rnd
public LABInitialMeans(RandomFactory rnd)
rnd
- Random generatorpublic 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 functionprotected static double getMinDist(DBIDArrayIter j, DistanceQuery<?> distQ, DBIDArrayIter mi, WritableDoubleDataStore mindist)
j
- current objectdistQ
- distance querymi
- medoid iteratormindist
- distance storageprivate static void shuffle(ArrayModifiableDBIDs ids, int ssize, int end, java.util.Random random)
ids
- IDs to shufflessize
- sample size to generateend
- Valid rangerandom
- Random generatorCopyright © 2019 ELKI Development Team. License information.