Package elki.clustering.kmeans.spherical
Class SphericalSimplifiedHamerlyKMeans<V extends NumberVector>
- java.lang.Object
-
- elki.clustering.kmeans.AbstractKMeans<V,KMeansModel>
-
- elki.clustering.kmeans.spherical.SphericalKMeans<V>
-
- elki.clustering.kmeans.spherical.SphericalSimplifiedHamerlyKMeans<V>
-
- Type Parameters:
V
- vector datatype
- All Implemented Interfaces:
Algorithm
,ClusteringAlgorithm<Clustering<KMeansModel>>
,KMeans<V,KMeansModel>
@Reference(authors="Erich Schubert, Andreas Lang, Gloria Feher",title="Accelerating Spherical k-Means",booktitle="Int. Conf. on Similarity Search and Applications, SISAP 2021",url="https://doi.org/10.1007/978-3-030-89657-7_17",bibkey="DBLP:conf/sisap/SchubertLF21") @Reference(authors="Erich Schubert",title="A Triangle Inequality for Cosine Similarity",booktitle="Int. Conf. on Similarity Search and Applications, SISAP 2021",url="https://doi.org/10.1007/978-3-030-89657-7_3",bibkey="DBLP:conf/sisap/Schubert21") public class SphericalSimplifiedHamerlyKMeans<V extends NumberVector> extends SphericalKMeans<V>
A spherical k-Means algorithm based on Hamerly's fast k-means by exploiting the triangle inequality.FIXME: currently requires the vectors to be L2 normalized beforehand
Reference:
Erich Schubert, Andreas Lang, Gloria Feher
Accelerating Spherical k-Means
Int. Conf. on Similarity Search and Applications, SISAP 2021The underlying triangle inequality used for pruning is introduced in:
Erich Schubert
A Triangle Inequality for Cosine Similarity
Int. Conf. on Similarity Search and Applications, SISAP 2021- Since:
- 0.8.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SphericalSimplifiedHamerlyKMeans.Instance
Inner instance, storing state for a single data set.static class
SphericalSimplifiedHamerlyKMeans.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.protected boolean
varstat
Flag whether to compute the final variance statistic.-
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 SphericalSimplifiedHamerlyKMeans(int k, int maxiter, KMeansInitialization initializer, boolean varstat)
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.spherical.SphericalKMeans
getInputTypeRestriction
-
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.
-
varstat
protected boolean varstat
Flag whether to compute the final variance statistic.
-
-
Constructor Detail
-
SphericalSimplifiedHamerlyKMeans
public SphericalSimplifiedHamerlyKMeans(int k, int maxiter, KMeansInitialization initializer, boolean varstat)
Constructor.- Parameters:
k
- k parametermaxiter
- Maxiter parameterinitializer
- Initialization methodvarstat
- Compute the variance statistic
-
-
Method Detail
-
run
public Clustering<KMeansModel> run(Relation<V> relation)
Description copied from interface:KMeans
Run the clustering algorithm.- Specified by:
run
in interfaceKMeans<V extends NumberVector,KMeansModel>
- Overrides:
run
in classSphericalKMeans<V extends NumberVector>
- Parameters:
relation
- Relation to process.- Returns:
- Clustering result
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractKMeans
Get the (STATIC) logger for this class.- Overrides:
getLogger
in classSphericalKMeans<V extends NumberVector>
- Returns:
- the static logger
-
-