Class FasterPAM<O>

  • Type Parameters:
    O - object datatype
    All Implemented Interfaces:
    elki.Algorithm, ClusteringAlgorithm<Clustering<MedoidModel>>, KMedoidsClustering<O>
    Direct Known Subclasses:
    FasterCLARA

    @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 FasterPAM<O>
    extends FastPAM<O>
    Variation of FastPAM that eagerly performs any swap that yields an improvement during an iteration. Compared to EagerPAM it considers all current medoids together, and chooses the best of these; hence apart from computing candidate swaps O(k) times faster, it will also be able to sometimes choose better swaps.

    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.8.0
    Author:
    Erich Schubert
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  FasterPAM.Instance
      Instance for a single dataset.
      static class  FasterPAM.Par<O>
      Parameterization class.
      • Nested classes/interfaces inherited from interface elki.Algorithm

        elki.Algorithm.Utils
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String KEY
      Key for statistics logging.
      private static elki.logging.Logging LOG
      The logger for this class.
    • Constructor Summary

      Constructors 
      Constructor Description
      FasterPAM​(elki.distance.Distance<? super O> distance, int k, int maxiter, KMedoidsInitialization<O> initializer)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected elki.logging.Logging getLogger()
      Get the static class logger.
      Clustering<MedoidModel> run​(elki.database.relation.Relation<O> relation, int k, elki.database.query.distance.DistanceQuery<? super O> distQ)
      Run k-medoids clustering with a given distance query.
      Not a very elegant API, but needed for some types of nested k-medoids.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

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

        private static final java.lang.String KEY
        Key for statistics logging.
    • Constructor Detail

      • FasterPAM

        public FasterPAM​(elki.distance.Distance<? super O> distance,
                         int k,
                         int maxiter,
                         KMedoidsInitialization<O> initializer)
        Constructor.
        Parameters:
        distance - distance function
        k - k parameter
        maxiter - Maxiter parameter
        initializer - Function to generate the initial means
    • 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 FastPAM<O>
        Parameters:
        relation - relation to use
        k - Number of clusters
        distQ - Distance query to use
        Returns:
        result
      • getLogger

        protected elki.logging.Logging getLogger()
        Description copied from class: PAM
        Get the static class logger.
        Overrides:
        getLogger in class FastPAM<O>