Class Predefined
- java.lang.Object
-
- elki.clustering.kmeans.initialization.AbstractKMeansInitialization
-
- elki.clustering.kmeans.initialization.Predefined
-
- All Implemented Interfaces:
KMeansInitialization
public class Predefined extends AbstractKMeansInitialization
Run k-means with prespecified initial means.- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Predefined.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description (package private) double[][]
initialMeans
Initial means to return.-
Fields inherited from class elki.clustering.kmeans.initialization.AbstractKMeansInitialization
rnd
-
-
Constructor Summary
Constructors Constructor Description Predefined(double[][] initialMeans)
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 meansvoid
setInitialClusters(java.util.List<? extends Cluster<? extends MeanModel>> initialMeans)
Set the initial means.void
setInitialMeans(double[][] initialMeans)
Set the initial means.void
setInitialMeans(java.util.List<double[]> initialMeans)
Set the initial means.-
Methods inherited from class elki.clustering.kmeans.initialization.AbstractKMeansInitialization
unboxVectors
-
-
-
-
Method Detail
-
setInitialMeans
public void setInitialMeans(java.util.List<double[]> initialMeans)
Set the initial means. Important notice: Use with care - the means are not copied!- Parameters:
initialMeans
- initial means.
-
setInitialClusters
public void setInitialClusters(java.util.List<? extends Cluster<? extends MeanModel>> initialMeans)
Set the initial means. Important notice: Use with care - the means are not copied!- Parameters:
initialMeans
- initial means.
-
setInitialMeans
public void setInitialMeans(double[][] initialMeans)
Set the initial means. Important notice: Use with care - the means are not copied!- Parameters:
initialMeans
- initial means.
-
chooseInitialMeans
public double[][] chooseInitialMeans(Relation<? extends NumberVector> relation, int k, NumberVectorDistance<?> distance)
Description copied from interface:KMeansInitialization
Choose initial means- Parameters:
relation
- Relationk
- Parameter kdistance
- Distance function- Returns:
- List of chosen means for k-means
-
-