Class KMeansMinusMinus.Instance

    • Field Detail

      • heapsize

        int heapsize
        Desired size of the heap.
      • prevvartotal

        double prevvartotal
        Variance of the previous iteration
    • Constructor Detail

      • Instance

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

      • iterate

        protected int iterate​(int iteration)
        Description copied from class: AbstractKMeans.Instance
        Main loop function.
        Specified by:
        iterate in class AbstractKMeans.Instance
        Parameters:
        iteration - Iteration number (beginning at 1)
        Returns:
        Number of reassigned points
      • assignToNearestCluster

        protected int assignToNearestCluster()
        Returns a list of clusters. The kth cluster contains the ids of those FeatureVectors, that are nearest to the kth mean. And saves the distance in a MinHeap.
        Overrides:
        assignToNearestCluster in class AbstractKMeans.Instance
        Returns:
        the number of reassigned objects
      • meansWithTreshhold

        protected double[][] meansWithTreshhold​(double tresh)
        Returns the mean vectors of the given clusters in the given database.
        Parameters:
        tresh - Threshold
        Returns:
        the mean vectors of the given clusters in the given database