Package elki.clustering.kmeans
Class GMeans<V extends NumberVector,M extends MeanModel>
- java.lang.Object
-
- elki.clustering.kmeans.AbstractKMeans<V,M>
-
- elki.clustering.kmeans.XMeans<V,M>
-
- elki.clustering.kmeans.GMeans<V,M>
-
- Type Parameters:
V
- VectorM
- Model
- All Implemented Interfaces:
Algorithm
,ClusteringAlgorithm<Clustering<M>>
,KMeans<V,M>
@Title("G-means") @Reference(authors="G. Hamerly and C. Elkan", title="Learning the k in k-means", booktitle="Neural Information Processing Systems", url="https://www.researchgate.net/publication/2869155_Learning_the_K_in_K-Means", bibkey="DBLP:conf/nips/HamerlyE03") public class GMeans<V extends NumberVector,M extends MeanModel> extends XMeans<V,M>
G-Means extends K-Means and estimates the number of centers with Anderson Darling Test.
Implemented as specialization of XMeans.Reference:
G. Hamerly and C. Elkan
Learning the K in K-Means
Neural Information Processing Systems- Since:
- 0.8.0
- Author:
- Robert Gehde
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GMeans.Par<V extends NumberVector,M extends MeanModel>
Parameterization class.-
Nested classes/interfaces inherited from class elki.clustering.kmeans.AbstractKMeans
AbstractKMeans.Instance
-
Nested classes/interfaces inherited from interface elki.Algorithm
Algorithm.Utils
-
-
Field Summary
Fields Modifier and Type Field Description protected double
critical
Critical valueprivate static Logging
LOG
The logger for this class.-
Fields inherited from class elki.clustering.kmeans.XMeans
informationCriterion, innerKMeans, rnd, splitInitializer
-
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 GMeans(NumberVectorDistance<? super V> distance, double critical, int k_min, int k_max, int maxiter, KMeans<V,M> innerKMeans, KMeansInitialization initializer, RandomFactory random)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Logging
getLogger()
Get the (STATIC) logger for this class.protected double[][]
splitCentroid(Cluster<? extends MeanModel> parentCluster, Relation<V> relation)
Split an existing centroid into two initial centers.protected java.util.List<Cluster<M>>
splitCluster(Cluster<M> parentCluster, Relation<V> relation)
Conditionally splits the clusters based on the information criterion.-
Methods inherited from class elki.clustering.kmeans.XMeans
getInputTypeRestriction, run
-
Methods inherited from class elki.clustering.kmeans.AbstractKMeans
getDistance, 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.
-
critical
protected double critical
Critical value
-
-
Constructor Detail
-
GMeans
public GMeans(NumberVectorDistance<? super V> distance, double critical, int k_min, int k_max, int maxiter, KMeans<V,M> innerKMeans, KMeansInitialization initializer, RandomFactory random)
Constructor.- Parameters:
distance
- Distance functioncritical
- Critical valuek_min
- Minimum number of clustersk_max
- Maximum number of clustersmaxiter
- Maximum number of iterationsinnerKMeans
- Nested k-means algorithminitializer
- Initialization methodrandom
- Random generator
-
-
Method Detail
-
splitCluster
protected java.util.List<Cluster<M>> splitCluster(Cluster<M> parentCluster, Relation<V> relation)
Description copied from class:XMeans
Conditionally splits the clusters based on the information criterion.- Overrides:
splitCluster
in classXMeans<V extends NumberVector,M extends MeanModel>
- Parameters:
parentCluster
- Cluster to splitrelation
- Data relation- Returns:
- Parent cluster when split decreases clustering quality or child clusters when split improves clustering.
-
splitCentroid
protected double[][] splitCentroid(Cluster<? extends MeanModel> parentCluster, Relation<V> relation)
Description copied from class:XMeans
Split an existing centroid into two initial centers.- Overrides:
splitCentroid
in classXMeans<V extends NumberVector,M extends MeanModel>
- Parameters:
parentCluster
- Existing clusterrelation
- Data relation- Returns:
- List of new centroids
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractKMeans
Get the (STATIC) logger for this class.
-
-