Class SphericalHamerlyKMeans<V extends elki.data.NumberVector>

  • Type Parameters:
    V - vector datatype
    All Implemented Interfaces:
    elki.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 SphericalHamerlyKMeans<V extends elki.data.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 2021

    The 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
    • Field Detail

      • LOG

        private static final elki.logging.Logging LOG
        The logger for this class.
      • varstat

        protected boolean varstat
        Flag whether to compute the final variance statistic.
    • Constructor Detail

      • SphericalHamerlyKMeans

        public SphericalHamerlyKMeans​(int k,
                                      int maxiter,
                                      KMeansInitialization initializer,
                                      boolean varstat)
        Constructor.
        Parameters:
        k - k parameter
        maxiter - Maxiter parameter
        initializer - Initialization method
        varstat - Compute the variance statistic
    • Method Detail

      • run

        public Clustering<KMeansModel> run​(elki.database.relation.Relation<V> relation)
        Description copied from interface: KMeans
        Run the clustering algorithm.
        Specified by:
        run in interface KMeans<V extends elki.data.NumberVector,​KMeansModel>
        Overrides:
        run in class SphericalKMeans<V extends elki.data.NumberVector>
        Parameters:
        relation - Relation to process.
        Returns:
        Clustering result
      • getLogger

        protected elki.logging.Logging getLogger()
        Description copied from class: AbstractKMeans
        Get the (STATIC) logger for this class.
        Overrides:
        getLogger in class SphericalKMeans<V extends elki.data.NumberVector>
        Returns:
        the static logger