Class SphericalHamerlyKMeans.Instance

    • Field Detail

      • sums

        double[][] sums
        Sum aggregate for the new mean.
      • newmeans

        double[][] newmeans
        Scratch space for new means.
      • csim

        double[] csim
        Cluster self-similarity.
    • Constructor Detail

      • Instance

        public Instance​(Relation<? extends NumberVector> relation,
                        double[][] means)
        Constructor.
        Parameters:
        relation - Relation
        means - Initial means
    • Method Detail

      • iterate

        public int iterate​(int iteration)
        Description copied from class: AbstractKMeans.Instance
        Main loop function.
        Overrides:
        iterate in class SphericalKMeans.Instance
        Parameters:
        iteration - Iteration number (beginning at 1)
        Returns:
        Number of reassigned points
      • initialAssignToNearestCluster

        protected int initialAssignToNearestCluster()
        Perform initial cluster assignment.
        Returns:
        Number of changes (i.e., relation size)
      • recomputeSeperation

        protected void recomputeSeperation​(double[] csim)
        Recompute the separation of cluster means.

        Used by Hamerly.

        Parameters:
        csim - Output array of separation
      • updateBounds

        protected void updateBounds​(double[] msim)
        Update the bounds for k-means.
        Parameters:
        msim - Similarity movement of centers