Package elki.clustering.kmeans
Interface KMeans<V extends NumberVector,M extends Model>
-
- Type Parameters:
V- Number vector typeM- Actual model type
- All Superinterfaces:
Algorithm,ClusteringAlgorithm<Clustering<M>>
- All Known Implementing Classes:
AbstractKMeans,AnnulusKMeans,BestOfMultipleKMeans,BetulaLloydKMeans,BisectingKMeans,CompareMeans,ElkanKMeans,EuclideanSphericalElkanKMeans,EuclideanSphericalHamerlyKMeans,EuclideanSphericalSimplifiedElkanKMeans,ExponionKMeans,GMeans,HamerlyKMeans,HartiganWongKMeans,KDTreeFilteringKMeans,KDTreePruningKMeans,KMeansMinusMinus,KMediansLloyd,LloydKMeans,MacQueenKMeans,ParallelLloydKMeans,SameSizeKMeans,ShallotKMeans,SimplifiedElkanKMeans,SingleAssignmentKMeans,SortMeans,SphericalElkanKMeans,SphericalHamerlyKMeans,SphericalKMeans,SphericalSimplifiedElkanKMeans,SphericalSimplifiedHamerlyKMeans,SphericalSingleAssignmentKMeans,XMeans,YinYangKMeans
public interface KMeans<V extends NumberVector,M extends Model> extends ClusteringAlgorithm<Clustering<M>>
Some constants and options shared among kmeans family algorithms.- Since:
- 0.1
- Author:
- Erich Schubert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface elki.Algorithm
Algorithm.Utils
-
-
Field Summary
Fields Modifier and Type Field Description static OptionIDDISTANCE_FUNCTION_IDOptionID for the distance function.static OptionIDINIT_IDParameter to specify the initialization methodstatic OptionIDK_IDParameter to specify the number of clusters to find, must be an integer greater than 0.static OptionIDMAXITER_IDParameter to specify the number of clusters to find, must be an integer greater or equal to 0, where 0 means no limit.static OptionIDSEED_IDParameter to specify the random generator seed.static OptionIDVARSTAT_IDFlag to compute the final clustering variance statistic (for methods that employ bounds to avoid computing all distances).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NumberVectorDistance<? super V>getDistance()Returns the distance.Clustering<M>run(Relation<V> rel)Run the clustering algorithm.voidsetDistance(NumberVectorDistance<? super V> distance)Set the distance function to use.voidsetInitializer(KMeansInitialization init)Set the initialization method.voidsetK(int k)Set the value of k.-
Methods inherited from interface elki.Algorithm
getInputTypeRestriction
-
Methods inherited from interface elki.clustering.ClusteringAlgorithm
autorun
-
-
-
-
Field Detail
-
DISTANCE_FUNCTION_ID
static final OptionID DISTANCE_FUNCTION_ID
OptionID for the distance function.
-
INIT_ID
static final OptionID INIT_ID
Parameter to specify the initialization method
-
K_ID
static final OptionID K_ID
Parameter to specify the number of clusters to find, must be an integer greater than 0.
-
MAXITER_ID
static final OptionID MAXITER_ID
Parameter to specify the number of clusters to find, must be an integer greater or equal to 0, where 0 means no limit.
-
SEED_ID
static final OptionID SEED_ID
Parameter to specify the random generator seed.
-
VARSTAT_ID
static final OptionID VARSTAT_ID
Flag to compute the final clustering variance statistic (for methods that employ bounds to avoid computing all distances).
-
-
Method Detail
-
run
Clustering<M> run(Relation<V> rel)
Run the clustering algorithm.- Parameters:
rel- Relation to process.- Returns:
- Clustering result
-
setK
void setK(int k)
Set the value of k. Needed for some types of nested k-means.- Parameters:
k- K parameter
-
setDistance
void setDistance(NumberVectorDistance<? super V> distance)
Set the distance function to use.- Parameters:
distance- Distance function.
-
getDistance
NumberVectorDistance<? super V> getDistance()
Returns the distance.- Returns:
- the distance
-
setInitializer
void setInitializer(KMeansInitialization init)
Set the initialization method.- Parameters:
init- Initialization method
-
-