Class KMeansPlusPlus.MedoidsInstance
- java.lang.Object
-
- elki.clustering.kmeans.initialization.KMeansPlusPlus.Instance<DBIDRef>
-
- elki.clustering.kmeans.initialization.KMeansPlusPlus.MedoidsInstance
-
- Enclosing class:
- KMeansPlusPlus<O>
protected static class KMeansPlusPlus.MedoidsInstance extends KMeansPlusPlus.Instance<DBIDRef>
Instance for k-medoids.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) DistanceQuery<?>
distQ
Distance query-
Fields inherited from class elki.clustering.kmeans.initialization.KMeansPlusPlus.Instance
diststat, ids, random, weights
-
-
Constructor Summary
Constructors Constructor Description MedoidsInstance(DBIDs ids, DistanceQuery<?> distQ, RandomFactory rnd)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
chooseRemaining(int k, ArrayModifiableDBIDs means, double weightsum)
Choose remaining means, weighted by distance.protected double
distance(DBIDRef a, DBIDRef b)
Compute the distance of two objects.DBIDs
run(int k)
-
Methods inherited from class elki.clustering.kmeans.initialization.KMeansPlusPlus.Instance
initialWeights, nextDouble, updateWeights
-
-
-
-
Field Detail
-
distQ
DistanceQuery<?> distQ
Distance query
-
-
Constructor Detail
-
MedoidsInstance
public MedoidsInstance(DBIDs ids, DistanceQuery<?> distQ, RandomFactory rnd)
-
-
Method Detail
-
run
public DBIDs run(int k)
-
distance
protected double distance(DBIDRef a, DBIDRef b)
Description copied from class:KMeansPlusPlus.Instance
Compute the distance of two objects.- Specified by:
distance
in classKMeansPlusPlus.Instance<DBIDRef>
- Parameters:
a
- First objectb
- Second object- Returns:
- Distance
-
chooseRemaining
protected void chooseRemaining(int k, ArrayModifiableDBIDs means, double weightsum)
Choose remaining means, weighted by distance.- Parameters:
k
- Number of means to choosemeans
- Means storageweightsum
- Sum of weights
-
-