Class FastMSC.Instance

  • Direct Known Subclasses:
    FasterMSC.Instance
    Enclosing class:
    FastMSC<O>

    protected class FastMSC.Instance
    extends java.lang.Object
    FastMSC clustering instance for a particular data set.
    Author:
    Erich Schubert
    • Constructor Detail

    • Method Detail

      • run

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

        protected double assignToNearestCluster​(ArrayDBIDs means)
        Assign each object to the nearest cluster.
        Parameters:
        means - Cluster medoids
        Returns:
        loss
      • findBestSwap

        protected double findBestSwap​(DBIDRef j,
                                      double[] ploss)
        Compute the loss change when choosing j as new medoid.
        Parameters:
        j - New medoid
        ploss - Loss array
        Returns:
        Shared loss term
      • doSwap

        protected double doSwap​(ArrayDBIDs medoids,
                                int b,
                                DBIDRef j)
        Assign each object to the nearest cluster when replacing one medoid.
        Parameters:
        medoids - Cluster medoids
        b - Medoid position index
        j - New medoid
        Returns:
        medoid silhouette
      • updateThirdNearest

        protected void updateThirdNearest​(DBIDRef j,
                                          FastMSC.Record rec,
                                          int m,
                                          double bestd,
                                          DBIDArrayIter miter)
        Update the third nearest in the record.
        Parameters:
        j - Current object
        rec - Current record
        m - Medoid id replaced
        bestd - distance to medoid
        miter - Medoid iterator
      • updateRemovalLoss

        protected void updateRemovalLoss​(double[] losses)
        Update the share removal loss data
        Parameters:
        losses - Removal loss storage
      • silhouetteScores

        public DoubleDataStore silhouetteScores()
        Get the silhouette scores per point (must be run() first)
        Returns:
        Silhouette scores