Class KMeansPlusPlus.Instance<T>
- java.lang.Object
-
- elki.clustering.kmeans.initialization.KMeansPlusPlus.Instance<T>
-
- Type Parameters:
T
- Object type handled
- Direct Known Subclasses:
KMeansPlusPlus.MedoidsInstance
,KMeansPlusPlus.NumberVectorInstance
- Enclosing class:
- KMeansPlusPlus<O>
protected abstract static class KMeansPlusPlus.Instance<T> extends java.lang.Object
Abstract instance implementing the weight handling.- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Constructor Description Instance(DBIDs ids, RandomFactory rnd)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract double
distance(T a, DBIDRef b)
Compute the distance of two objects.protected double
initialWeights(T first)
Initialize the weight list.protected double
nextDouble(double weightsum)
protected double
updateWeights(T latest)
Update the weight list.
-
-
-
Field Detail
-
ids
protected DBIDs ids
Object IDs
-
weights
protected WritableDoubleDataStore weights
Weights
-
diststat
protected long diststat
Count the number of distance computations.
-
random
protected java.util.Random random
Random generator
-
-
Constructor Detail
-
Instance
public Instance(DBIDs ids, RandomFactory rnd)
Constructor.- Parameters:
ids
- IDs to processrnd
- Random generator
-
-
Method Detail
-
distance
protected abstract double distance(T a, DBIDRef b)
Compute the distance of two objects.- Parameters:
a
- First objectb
- Second object- Returns:
- Distance
-
initialWeights
protected double initialWeights(T first)
Initialize the weight list.- Parameters:
first
- Added ID- Returns:
- Weight sum
-
updateWeights
protected double updateWeights(T latest)
Update the weight list.- Parameters:
latest
- Added ID- Returns:
- Weight sum
-
nextDouble
protected double nextDouble(double weightsum)
-
-