Class KMeansPlusPlus.NumberVectorInstance

    • Constructor Detail

      • NumberVectorInstance

        public NumberVectorInstance​(Relation<? extends NumberVector> relation,
                                    NumberVectorDistance<?> distance,
                                    RandomFactory rnd)
        Constructor.
        Parameters:
        relation - Data relation to process
        distance - Distance function
        rnd - Random generator
    • Method Detail

      • run

        public double[][] run​(int k)
        Run k-means++ initialization for number vectors.
        Parameters:
        k - K
        Returns:
        Vectors
      • chooseRemaining

        protected void chooseRemaining​(int k,
                                       java.util.List<NumberVector> means,
                                       double weightsum)
        Choose remaining means, weighted by distance.
        Parameters:
        k - Number of means to choose
        means - Means storage
        weightsum - Sum of weights