Package elki.clustering.kmeans
Class LloydKMeans<V extends NumberVector>
- java.lang.Object
-
- elki.clustering.kmeans.AbstractKMeans<V,KMeansModel>
-
- elki.clustering.kmeans.LloydKMeans<V>
-
- Type Parameters:
V
- vector datatype
- All Implemented Interfaces:
Algorithm
,ClusteringAlgorithm<Clustering<KMeansModel>>
,KMeans<V,KMeansModel>
@Title("k-Means (Lloyd/Forgy Algorithm)") @Reference(authors="S. Lloyd",title="Least squares quantization in PCM",booktitle="IEEE Transactions on Information Theory 28 (2): 129\u2013137.",url="https://doi.org/10.1109/TIT.1982.1056489",bibkey="DBLP:journals/tit/Lloyd82") @Reference(authors="E. W. Forgy",title="Cluster analysis of multivariate data: efficiency versus interpretability of classifications",booktitle="Biometrics 21(3)",bibkey="journals/biometrics/Forgy65") @Alias({"lloyd","forgy"}) public class LloydKMeans<V extends NumberVector> extends AbstractKMeans<V,KMeansModel>
The standard k-means algorithm, using bulk iterations and commonly attributed to Lloyd and Forgy (independently).Reference:
S. Lloyd
Least squares quantization in PCM
IEEE Transactions on Information Theory 28 (2)
previously published as Bell Telephone Laboratories PaperE. W. Forgy
Cluster analysis of multivariate data: efficiency versus interpretability of classifications
Abstract published in Biometrics 21(3)- Since:
- 0.5.0
- Author:
- Arthur Zimek
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
LloydKMeans.Instance
Inner instance, storing state for a single data set.static class
LloydKMeans.Par<V extends NumberVector>
Parameterization class.-
Nested classes/interfaces inherited from interface elki.Algorithm
Algorithm.Utils
-
-
Field Summary
Fields Modifier and Type Field Description private static Logging
LOG
The logger for this class.-
Fields inherited from class elki.clustering.kmeans.AbstractKMeans
distance, initializer, k, maxiter
-
Fields inherited from interface elki.clustering.kmeans.KMeans
DISTANCE_FUNCTION_ID, INIT_ID, K_ID, MAXITER_ID, SEED_ID, VARSTAT_ID
-
-
Constructor Summary
Constructors Constructor Description LloydKMeans(NumberVectorDistance<? super V> distance, int k, int maxiter, KMeansInitialization initializer)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Logging
getLogger()
Get the (STATIC) logger for this class.Clustering<KMeansModel>
run(Relation<V> relation)
Run the clustering algorithm.-
Methods inherited from class elki.clustering.kmeans.AbstractKMeans
getDistance, getInputTypeRestriction, incrementalUpdateMean, initialMeans, means, minusEquals, nearestMeans, plusEquals, plusMinusEquals, setDistance, setInitializer, setK
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.clustering.ClusteringAlgorithm
autorun
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
The logger for this class.
-
-
Constructor Detail
-
LloydKMeans
public LloydKMeans(NumberVectorDistance<? super V> distance, int k, int maxiter, KMeansInitialization initializer)
Constructor.- Parameters:
distance
- distance functionk
- k parametermaxiter
- Maxiter parameterinitializer
- Initialization method
-
-
Method Detail
-
run
public Clustering<KMeansModel> run(Relation<V> relation)
Description copied from interface:KMeans
Run the clustering algorithm.- Parameters:
relation
- Relation to process.- Returns:
- Clustering result
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractKMeans
Get the (STATIC) logger for this class.- Specified by:
getLogger
in classAbstractKMeans<V extends NumberVector,KMeansModel>
- Returns:
- the static logger
-
-