Class PAMSIL.Instance

  • Direct Known Subclasses:
    PAMMEDSIL.Instance
    Enclosing class:
    PAMSIL<O>

    protected static class PAMSIL.Instance
    extends java.lang.Object
    Instance for a single dataset.
    Author:
    Erich Schubert
    • Constructor Detail

    • Method Detail

      • run

        protected double run​(ArrayModifiableDBIDs medoids,
                             int maxiter)
        Run the PAMSIL optimization phase.
        Parameters:
        medoids - Initial medoids list
        maxiter - Maximum number of iterations
        Returns:
        final Silhouette
      • assignToNearestCluster

        protected void assignToNearestCluster​(ArrayDBIDs medoids)
        Assign each object to the nearest cluster.
        Parameters:
        medoids - Cluster medoids
      • silhouette

        protected double silhouette​(IntegerDataStore assignment,
                                    int k)
        Evaluate the average Silhouette of the current cluster assignment
        Parameters:
        assignment - cluster assignment
        k - number of clusters (for memory allocation)
        Returns:
        Average silhouette width
      • reassignToNearestCluster

        protected void reassignToNearestCluster​(IntegerDataStore prev,
                                                WritableIntegerDataStore assignment,
                                                ArrayDBIDs medoids,
                                                int pi,
                                                DBIDRef h)
        Assign each object to the nearest cluster when replacing one medoid.
        Parameters:
        prev - Previous assignment
        assignment - New assignment
        medoids - Previous cluster medoids
        pi - Medoid position
        h - New medoid