Class Silhouette<O>

  • Type Parameters:
    O - Object type
    All Implemented Interfaces:
    Evaluator, ResultProcessor

    @Reference(authors="P. J. Rousseeuw",
               title="Silhouettes: A graphical aid to the interpretation and validation of cluster analysis",
               booktitle="Journal of Computational and Applied Mathematics, Volume 20",
               url="https://doi.org/10.1016/0377-0427(87)90125-7",
               bibkey="doi:10.1016/0377-04278790125-7")
    public class Silhouette<O>
    extends java.lang.Object
    implements Evaluator
    Compute the silhouette of a data set.

    Reference:

    P. J. Rousseeuw
    Silhouettes: A graphical aid to the interpretation and validation of cluster analysis
    In: Journal of Computational and Applied Mathematics Volume 20, November 1987

    TODO: keep all silhouette values, and allow visualization!

    Since:
    0.7.0
    Author:
    Erich Schubert
    • Field Detail

      • LOG

        private static final Logging LOG
        Logger for debug output.
      • SILHOUETTE_NAME

        public static final java.lang.String SILHOUETTE_NAME
        Name of the silhouette result.
        See Also:
        Constant Field Values
      • distance

        private Distance<? super O> distance
        Distance function to use.
      • noiseOption

        private NoiseHandling noiseOption
        Option for noise handling.
      • key

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

      • Silhouette

        public Silhouette​(Distance<? super O> distance,
                          NoiseHandling noiseOption,
                          boolean penalize)
        Constructor.
        Parameters:
        distance - Distance function
        noiseOption - Handling of "noise" clusters.
        penalize - noise, if NoiseHandling.IGNORE_NOISE is set.
      • Silhouette

        public Silhouette​(Distance<? super O> distance,
                          boolean mergenoise)
        Constructor.
        Parameters:
        distance - Distance function
        mergenoise - Flag to treat noise as clusters, instead of breaking them into singletons.
    • Method Detail

      • evaluateClustering

        public double evaluateClustering​(Relation<O> rel,
                                         DistanceQuery<O> dq,
                                         Clustering<?> c)
        Evaluate a single clustering.
        Parameters:
        rel - Data relation
        dq - Distance query
        c - Clustering
        Returns:
        Average silhouette
      • processNewResult

        public void processNewResult​(java.lang.Object result)
        Description copied from interface: ResultProcessor
        Process a result.
        Specified by:
        processNewResult in interface ResultProcessor
        Parameters:
        result - Newly added result subtree.