Class BisectingKMeans<V extends elki.data.NumberVector,​M extends MeanModel>

  • Type Parameters:
    V - Vector type
    M - Model type
    All Implemented Interfaces:
    elki.Algorithm, ClusteringAlgorithm<Clustering<M>>, KMeans<V,​M>

    @Reference(authors="M. Steinbach, G. Karypis, V. Kumar",
               title="A Comparison of Document Clustering Techniques",
               booktitle="KDD workshop on text mining. Vol. 400. No. 1",
               url="http://glaros.dtc.umn.edu/gkhome/fetch/papers/docclusterKDDTMW00.pdf",
               bibkey="conf/kdd/SteinbachKK00")
    public class BisectingKMeans<V extends elki.data.NumberVector,​M extends MeanModel>
    extends java.lang.Object
    implements KMeans<V,​M>
    The bisecting k-means algorithm works by starting with an initial partitioning into two clusters, then repeated splitting of the largest cluster to get additional clusters.

    Reference:

    M. Steinbach, G. Karypis, V. Kumar
    A Comparison of Document Clustering Techniques
    KDD workshop on text mining. Vol. 400. No. 1

    Since:
    0.6.0
    Author:
    Stephan Baier
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface elki.Algorithm

        elki.Algorithm.Utils
    • Constructor Summary

      Constructors 
      Constructor Description
      BisectingKMeans​(int k, KMeans<V,​M> innerkMeans)
      Constructor.
    • Field Detail

      • LOG

        private static final elki.logging.Logging LOG
        The logger for this class.
      • innerkMeans

        private KMeans<V extends elki.data.NumberVector,​M extends MeanModel> innerkMeans
        Variant of kMeans for the bisecting step.
      • k

        private int k
        Desired value of k.
    • Constructor Detail

      • BisectingKMeans

        public BisectingKMeans​(int k,
                               KMeans<V,​M> innerkMeans)
        Constructor.
        Parameters:
        k - k parameter - number of result clusters
        innerkMeans - KMeans variant parameter - for bisecting step
    • Method Detail

      • getInputTypeRestriction

        public elki.data.type.TypeInformation[] getInputTypeRestriction()
        Specified by:
        getInputTypeRestriction in interface elki.Algorithm
      • run

        public Clustering<M> run​(elki.database.relation.Relation<V> relation)
        Description copied from interface: KMeans
        Run the clustering algorithm.
        Specified by:
        run in interface KMeans<V extends elki.data.NumberVector,​M extends MeanModel>
        Parameters:
        relation - Relation to process.
        Returns:
        Clustering result
      • getDistance

        public elki.distance.NumberVectorDistance<? super V> getDistance()
        Description copied from interface: KMeans
        Returns the distance.
        Specified by:
        getDistance in interface KMeans<V extends elki.data.NumberVector,​M extends MeanModel>
        Returns:
        the distance
      • setK

        public void setK​(int k)
        Description copied from interface: KMeans
        Set the value of k. Needed for some types of nested k-means.
        Specified by:
        setK in interface KMeans<V extends elki.data.NumberVector,​M extends MeanModel>
        Parameters:
        k - K parameter
      • setDistance

        public void setDistance​(elki.distance.NumberVectorDistance<? super V> distance)
        Description copied from interface: KMeans
        Set the distance function to use.
        Specified by:
        setDistance in interface KMeans<V extends elki.data.NumberVector,​M extends MeanModel>
        Parameters:
        distance - Distance function.
      • setInitializer

        public void setInitializer​(KMeansInitialization init)
        Description copied from interface: KMeans
        Set the initialization method.
        Specified by:
        setInitializer in interface KMeans<V extends elki.data.NumberVector,​M extends MeanModel>
        Parameters:
        init - Initialization method