Class ReynoldsPAM.Instance

  • Enclosing class:
    ReynoldsPAM<O>

    protected static class ReynoldsPAM.Instance
    extends PAM.Instance
    Instance for a single dataset.
    Author:
    Erich Schubert
    • Constructor Detail

    • Method Detail

      • run

        protected double run​(ArrayModifiableDBIDs medoids,
                             int maxiter)
        Run the PAM optimization phase.
        Overrides:
        run in class PAM.Instance
        Parameters:
        medoids - Medoids list
        maxiter -
        Returns:
        final cost
      • computeRemovalCost

        protected double computeRemovalCost​(int i,
                                            WritableDoubleDataStore tnearest)
        Compute the cost of removing a medoid just once. This can then be reused for every point, thus decreasing the runtime cost at low memory overhead.

        The output array contains for each medoid the cost of removing all its points, and reassigning them to the second nearest medoid instead.

        Parameters:
        i - Medoid to virtually remove
        tnearest - Output storage
        Returns:
        Cost
      • computeReassignmentCost

        protected double computeReassignmentCost​(DBIDRef h,
                                                 WritableDoubleDataStore tnearest)
        Compute the reassignment cost, for all medoids in one pass.
        Parameters:
        h - Current object to swap with any medoid.
        tnearest - Distance to the nearest except the removed medoid
        Returns:
        cost change