Class EagerPAM<O>

  • Type Parameters:
    O - object datatype
    All Implemented Interfaces:
    Algorithm, ClusteringAlgorithm<Clustering<MedoidModel>>, KMedoidsClustering<O>

    @Priority(-100)
    @Reference(authors="R. A. Whitaker",title="A Fast Algorithm For The Greedy Interchange For Large-Scale Clustering And Median Location Problems",booktitle="INFOR: Information Systems and Operational Research 21(2)",url="https://doi.org/10.1080/03155986.1983.11731889",bibkey="doi:10.1080/03155986.1983.11731889") @Reference(authors="V. Estivill-Castro and A. T. Murray",title="Discovering Associations in Spatial Data - An Efficient Medoid Based Approach",booktitle="Proc. 2nd Pacific-Asia Conf. on Research and Development in Knowledge Discovery and Data Mining, PAKDD-98",url="https://doi.org/10.1007/3-540-64383-4_10",bibkey="DBLP:conf/pakdd/Estivill-CastroM98")
    public class EagerPAM<O>
    extends PAM<O>
    Variation of PAM that eagerly performs all swaps that yield an improvement during an iteration. This has been used as early as in Whitaker's "fast interchange" heuristic, and constitutes a variant of the "local hill-climbing" approach considered by Estivill-Castro.

    Reference:

    R. A. Whitaker
    A Fast Algorithm For The Greedy Interchange For Large-Scale Clustering And Median Location Problems
    INFOR: Information Systems and Operational Research 21(2)

    V. Estivill-Castro and A. T. Murray
    Discovering Associations in Spatial Data - An Efficient Medoid Based Approach
    Proc. 2nd Pacific-Asia Conf. on Research and Development in Knowledge Discovery and Data Mining, PAKDD-98

    Since:
    0.8.0
    Author:
    Erich Schubert
    • Field Detail

      • LOG

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

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

      • EagerPAM

        public EagerPAM​(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​(Relation<O> relation,
                                           int k,
                                           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 PAM<O>
        Parameters:
        relation - relation to use
        k - Number of clusters
        distQ - Distance query to use
        Returns:
        result
      • getLogger

        protected Logging getLogger()
        Get the static class logger.
        Overrides:
        getLogger in class PAM<O>