Class SphericalKMeansPlusPlus<O>

  • Type Parameters:
    O - Vector type
    All Implemented Interfaces:
    KMeansInitialization

    @Title("Spherical K-means++")
    @Reference(authors="Y. Endo and S. Miyamoto",
               title="Spherical k-Means++ Clustering",
               booktitle="Modeling Decisions for Artificial Intelligence",
               url="https://doi.org/10.1007/978-3-319-23240-9_9",
               bibkey="DBLP:conf/mdai/EndoM15")
    public class SphericalKMeansPlusPlus<O>
    extends AbstractKMeansInitialization
    Spherical K-Means++ initialization for k-means.

    FIXME: currently assumes the vectors to be L2 normalized beforehand, but does not ensure that this is true.

    Reference:

    Y. Endo and S. Miyamoto
    Spherical k-Means++ Clustering
    Modeling Decisions for Artificial Intelligence

    Since:
    0.8.0
    Author:
    Erich Schubert
    • Field Detail

      • LOG

        private static final Logging LOG
        Class logger.
      • alpha

        protected double alpha
        Parameter to balance distance vs. uniform sampling.
    • Constructor Detail

      • SphericalKMeansPlusPlus

        public SphericalKMeansPlusPlus​(double alpha,
                                       RandomFactory rnd)
        Constructor.
        Parameters:
        alpha - alpha-SKM parameter, usually 1.5
        rnd - Random generator.
    • Method Detail

      • chooseInitialMeans

        public double[][] chooseInitialMeans​(Relation<? extends NumberVector> relation,
                                             int k,
                                             NumberVectorDistance<?> distance)
        Description copied from interface: KMeansInitialization
        Choose initial means
        Parameters:
        relation - Relation
        k - Parameter k
        distance - Distance function
        Returns:
        List of chosen means for k-means