Class SimplifiedSilhouette
- java.lang.Object
-
- elki.evaluation.clustering.internal.SimplifiedSilhouette
-
- All Implemented Interfaces:
Evaluator
,ResultProcessor
public class SimplifiedSilhouette extends java.lang.Object implements Evaluator
Compute the simplified silhouette of a data set.The simplified silhouette does not use pairwise distances, but distances to centroids only.
- Since:
- 0.7.0
- Author:
- Stephan Baier, Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SimplifiedSilhouette.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description private NumberVectorDistance<?>
distance
Distance function to use.private java.lang.String
key
Key for logging statistics.private static Logging
LOG
Logger for debug output.private NoiseHandling
noiseOption
Option for noise handling.private boolean
penalize
Penalize noise, ifNoiseHandling.IGNORE_NOISE
is set.
-
Constructor Summary
Constructors Constructor Description SimplifiedSilhouette(NumberVectorDistance<?> distance, NoiseHandling noiseOpt, boolean penalize)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
centroids(Relation<? extends NumberVector> rel, java.util.List<? extends Cluster<?>> clusters, NumberVector[] centroids, NoiseHandling noiseOption)
Compute centroids.double
evaluateClustering(Relation<? extends NumberVector> rel, Clustering<?> c)
Evaluate a single clustering.void
processNewResult(java.lang.Object result)
Process a result.
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Logger for debug output.
-
noiseOption
private NoiseHandling noiseOption
Option for noise handling.
-
distance
private NumberVectorDistance<?> distance
Distance function to use.
-
penalize
private boolean penalize
Penalize noise, ifNoiseHandling.IGNORE_NOISE
is set.
-
key
private java.lang.String key
Key for logging statistics.
-
-
Constructor Detail
-
SimplifiedSilhouette
public SimplifiedSilhouette(NumberVectorDistance<?> distance, NoiseHandling noiseOpt, boolean penalize)
Constructor.- Parameters:
distance
- Distance functionnoiseOpt
- Flag to control noise handlingpenalize
- noise, ifNoiseHandling.IGNORE_NOISE
is set.
-
-
Method Detail
-
evaluateClustering
public double evaluateClustering(Relation<? extends NumberVector> rel, Clustering<?> c)
Evaluate a single clustering.- Parameters:
rel
- Data relationc
- Clustering- Returns:
- Mean simplified silhouette
-
centroids
public static int centroids(Relation<? extends NumberVector> rel, java.util.List<? extends Cluster<?>> clusters, NumberVector[] centroids, NoiseHandling noiseOption)
Compute centroids.- Parameters:
rel
- Data relationclusters
- Clusterscentroids
- Output array for centroids- Returns:
- Number of ignored noise elements.
-
processNewResult
public void processNewResult(java.lang.Object result)
Description copied from interface:ResultProcessor
Process a result.- Specified by:
processNewResult
in interfaceResultProcessor
- Parameters:
result
- Newly added result subtree.
-
-