Class FarthestPoints<O>
- java.lang.Object
-
- elki.clustering.kmeans.initialization.AbstractKMeansInitialization
-
- elki.clustering.kmeans.initialization.FarthestPoints<O>
-
- Type Parameters:
O
- Object type for kMedoids and kMedians
- All Implemented Interfaces:
KMeansInitialization
,KMedoidsInitialization<O>
- Direct Known Subclasses:
FarthestSumPoints
public class FarthestPoints<O> extends AbstractKMeansInitialization implements KMedoidsInitialization<O>
K-Means initialization by repeatedly choosing the farthest point (by the minimum distance to earlier points).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
FarthestPoints.Par<O>
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
dropfirst
Discard the first vector.-
Fields inherited from class elki.clustering.kmeans.initialization.AbstractKMeansInitialization
rnd
-
-
Constructor Summary
Constructors Constructor Description FarthestPoints(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
-
FarthestPoints
public FarthestPoints(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
- 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>
- Parameters:
k
- Parameter kids
- Candidate IDs.distQ
- Distance function- Returns:
- List of chosen means for k-means
-
-