Class FasterCLARA<O>

  • Type Parameters:
    O - Data type
    All Implemented Interfaces:
    elki.Algorithm, ClusteringAlgorithm<Clustering<MedoidModel>>, KMedoidsClustering<O>

    @Reference(authors="Erich Schubert and Peter J. Rousseeuw",
               title="Fast and Eager k-Medoids Clustering: O(k) Runtime Improvement of the PAM, CLARA, and CLARANS Algorithms",
               booktitle="arXiv preprint",
               url="https://arxiv.org/abs/2008.05171",
               bibkey="DBLP:journals/corr/abs-2008-05171")
    public class FasterCLARA<O>
    extends FasterPAM<O>
    Clustering Large Applications (CLARA) with the FastPAM improvements, to increase scalability in the number of clusters. This variant will also default to twice the sample size, to improve quality.

    TODO: use a triangular distance matrix, rather than a hash-map based cache, for a bit better performance and less memory.

    Reference:

    Erich Schubert and Peter J. Rousseeuw
    Fast and Eager k-Medoids Clustering: O(k) Runtime Improvement of the PAM, CLARA, and CLARANS Algorithms
    Preprint

    Since:
    0.7.0
    Author:
    Erich Schubert
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  FasterCLARA.Par<V>
      Parameterization class.
      • Nested classes/interfaces inherited from interface elki.Algorithm

        elki.Algorithm.Utils
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) boolean keepmed
      Keep the previous medoids in the sample (see page 145).
      private static elki.logging.Logging LOG
      Class logger.
      (package private) int numsamples
      Number of samples to draw (i.e. iterations).
      (package private) elki.utilities.random.RandomFactory random
      Random factory for initialization.
      (package private) double sampling
      Sampling rate.
    • Constructor Summary

      Constructors 
      Constructor Description
      FasterCLARA​(elki.distance.Distance<? super O> distance, int k, int maxiter, KMedoidsInitialization<O> initializer, int numsamples, double sampling, boolean keepmed, elki.utilities.random.RandomFactory random)
      Constructor.
    • Field Detail

      • LOG

        private static final elki.logging.Logging LOG
        Class logger.
      • sampling

        double sampling
        Sampling rate. If less than 1, it is considered to be a relative value.
      • numsamples

        int numsamples
        Number of samples to draw (i.e. iterations).
      • keepmed

        boolean keepmed
        Keep the previous medoids in the sample (see page 145).
      • random

        elki.utilities.random.RandomFactory random
        Random factory for initialization.
    • Constructor Detail

      • FasterCLARA

        public FasterCLARA​(elki.distance.Distance<? super O> distance,
                           int k,
                           int maxiter,
                           KMedoidsInitialization<O> initializer,
                           int numsamples,
                           double sampling,
                           boolean keepmed,
                           elki.utilities.random.RandomFactory random)
        Constructor.
        Parameters:
        distance - Distance function to use
        k - Number of clusters to produce
        maxiter - Maximum number of iterations
        initializer - Initialization function
        numsamples - Number of samples (sampling iterations)
        sampling - Sampling rate (absolute or relative)
        keepmed - Keep the previous medoids in the next sample
        random - Random generator
    • Method Detail

      • run

        public Clustering<MedoidModel> run​(elki.database.relation.Relation<O> relation,
                                           int k,
                                           elki.database.query.distance.DistanceQuery<? super O> distQ)
        Description copied from interface: KMedoidsClustering
        Run k-medoids clustering with a given distance query.
        Not a very elegant API, but needed for some types of nested k-medoids.
        Specified by:
        run in interface KMedoidsClustering<O>
        Overrides:
        run in class FasterPAM<O>
        Parameters:
        relation - relation to use
        k - Number of clusters
        distQ - Distance query to use
        Returns:
        result