Class KMeansPlusPlus.Instance<T>

    • Field Detail

      • ids

        protected DBIDs ids
        Object IDs
      • diststat

        protected long diststat
        Count the number of distance computations.
      • random

        protected java.util.Random random
        Random generator
    • Constructor Detail

      • Instance

        public Instance​(DBIDs ids,
                        RandomFactory rnd)
        Constructor.
        Parameters:
        ids - IDs to process
        rnd - Random generator
    • Method Detail

      • distance

        protected abstract double distance​(T a,
                                           DBIDRef b)
        Compute the distance of two objects.
        Parameters:
        a - First object
        b - Second object
        Returns:
        Distance
      • initialWeights

        protected double initialWeights​(T first)
        Initialize the weight list.
        Parameters:
        first - Added ID
        Returns:
        Weight sum
      • updateWeights

        protected double updateWeights​(T latest)
        Update the weight list.
        Parameters:
        latest - Added ID
        Returns:
        Weight sum
      • nextDouble

        protected double nextDouble​(double weightsum)