Interface KMeans<V extends NumberVector,​M extends Model>

    • Field Detail

      • DISTANCE_FUNCTION_ID

        static final OptionID DISTANCE_FUNCTION_ID
        OptionID for the distance function.
      • INIT_ID

        static final OptionID INIT_ID
        Parameter to specify the initialization method
      • K_ID

        static final OptionID K_ID
        Parameter to specify the number of clusters to find, must be an integer greater than 0.
      • MAXITER_ID

        static final OptionID MAXITER_ID
        Parameter to specify the number of clusters to find, must be an integer greater or equal to 0, where 0 means no limit.
      • SEED_ID

        static final OptionID SEED_ID
        Parameter to specify the random generator seed.
      • VARSTAT_ID

        static final OptionID VARSTAT_ID
        Flag to compute the final clustering variance statistic (for methods that employ bounds to avoid computing all distances).
    • Method Detail

      • run

        Clustering<M> run​(Relation<V> rel)
        Run the clustering algorithm.
        Parameters:
        rel - Relation to process.
        Returns:
        Clustering result
      • setK

        void setK​(int k)
        Set the value of k. Needed for some types of nested k-means.
        Parameters:
        k - K parameter
      • setDistance

        void setDistance​(NumberVectorDistance<? super V> distance)
        Set the distance function to use.
        Parameters:
        distance - Distance function.
      • setInitializer

        void setInitializer​(KMeansInitialization init)
        Set the initialization method.
        Parameters:
        init - Initialization method