Class FarthestSumPoints<O>
- java.lang.Object
-
- elki.clustering.kmeans.initialization.AbstractKMeansInitialization
-
- elki.clustering.kmeans.initialization.FarthestPoints<O>
-
- elki.clustering.kmeans.initialization.FarthestSumPoints<O>
-
- Type Parameters:
O
- Object type for kmedoids and kmedians
- All Implemented Interfaces:
KMeansInitialization
,KMedoidsInitialization<O>
public class FarthestSumPoints<O> extends FarthestPoints<O>
K-Means initialization by repeatedly choosing the farthest point (by the sum of distances to previous objects).Note: this is less random than other initializations, so running multiple times will be more likely to return the same local minima.
- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FarthestSumPoints.Par<V>
Parameterization class.
-
Field Summary
-
Fields inherited from class elki.clustering.kmeans.initialization.FarthestPoints
dropfirst
-
Fields inherited from class elki.clustering.kmeans.initialization.AbstractKMeansInitialization
rnd
-
-
Constructor Summary
Constructors Constructor Description FarthestSumPoints(RandomFactory rnd, boolean dropfirst)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[][]
chooseInitialMeans(Relation<? extends NumberVector> relation, int k, NumberVectorDistance<?> distance)
Choose initial meansDBIDs
chooseInitialMedoids(int k, DBIDs ids, DistanceQuery<? super O> distQ)
Choose initial means-
Methods inherited from class elki.clustering.kmeans.initialization.AbstractKMeansInitialization
unboxVectors
-
-
-
-
Constructor Detail
-
FarthestSumPoints
public FarthestSumPoints(RandomFactory rnd, boolean dropfirst)
Constructor.- Parameters:
rnd
- Random generator.dropfirst
- Flag to discard the first vector.
-
-
Method Detail
-
chooseInitialMeans
public double[][] chooseInitialMeans(Relation<? extends NumberVector> relation, int k, NumberVectorDistance<?> distance)
Description copied from interface:KMeansInitialization
Choose initial means- Specified by:
chooseInitialMeans
in interfaceKMeansInitialization
- Overrides:
chooseInitialMeans
in classFarthestPoints<O>
- Parameters:
relation
- Relationk
- Parameter kdistance
- Distance function- Returns:
- List of chosen means for k-means
-
chooseInitialMedoids
public DBIDs chooseInitialMedoids(int k, DBIDs ids, DistanceQuery<? super O> distQ)
Description copied from interface:KMedoidsInitialization
Choose initial means- Specified by:
chooseInitialMedoids
in interfaceKMedoidsInitialization<O>
- Overrides:
chooseInitialMedoids
in classFarthestPoints<O>
- Parameters:
k
- Parameter kids
- Candidate IDs.distQ
- Distance function- Returns:
- List of chosen means for k-means
-
-