Class FirstK<O>
- java.lang.Object
-
- elki.clustering.kmeans.initialization.FirstK<O>
-
- Type Parameters:
O
- Object type for KMedoids
- All Implemented Interfaces:
KMeansInitialization
,KMedoidsInitialization<O>
@Reference(authors="J. MacQueen", title="Some Methods for Classification and Analysis of Multivariate Observations", booktitle="5th Berkeley Symp. Math. Statist. Prob.", url="http://projecteuclid.org/euclid.bsmsp/1200512992", bibkey="conf/bsmsp/MacQueen67") public class FirstK<O> extends java.lang.Object implements KMeansInitialization, KMedoidsInitialization<O>
Initialize K-means by using the first k objects as initial means.Reference:
J. MacQueen
Some Methods for Classification and Analysis of Multivariate Observations
5th Berkeley Symp. Math. Statist. Prob.- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FirstK.Par<V extends NumberVector>
Parameterization class.
-
Constructor Summary
Constructors Constructor Description FirstK()
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> distance)
Choose initial means
-
-
-
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> distance)
Description copied from interface:KMedoidsInitialization
Choose initial means- Specified by:
chooseInitialMedoids
in interfaceKMedoidsInitialization<O>
- Parameters:
k
- Parameter kids
- Candidate IDs.distance
- Distance function- Returns:
- List of chosen means for k-means
-
-