Class VarianceRatioCriterion
- java.lang.Object
-
- elki.evaluation.clustering.internal.VarianceRatioCriterion
-
- All Implemented Interfaces:
Evaluator
,ResultProcessor
@Reference(authors="R. B. Calinski, J. Harabasz", title="A dendrite method for cluster analysis", booktitle="Communications in Statistics - Theory and Methods 3(1)", url="https://doi.org/10.1080/03610927408827101", bibkey="doi:10.1080/03610927408827101") @Alias("calinski-harabasz") public class VarianceRatioCriterion extends java.lang.Object implements Evaluator
Compute the Variance Ratio Criterion of a data set, also known as Calinski-Harabasz index.Reference:
R. B. Calinski, J. Harabasz
A dendrite method for cluster analysis
Communications in Statistics - Theory and Methods 3(1)- Since:
- 0.7.0
- Author:
- Stephan Baier, Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VarianceRatioCriterion.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description 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 VarianceRatioCriterion(NoiseHandling noiseOption, boolean penalize)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
evaluateClustering(Relation<? extends NumberVector> rel, Clustering<?> c)
Evaluate a single clustering.static int
globalCentroid(Centroid overallCentroid, Relation<? extends NumberVector> rel, java.util.List<? extends Cluster<?>> clusters, NumberVector[] centroids, NoiseHandling noiseOption)
Update the global centroid.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.
-
penalize
private boolean penalize
Penalize noise, ifNoiseHandling.IGNORE_NOISE
is set.
-
key
private java.lang.String key
Key for logging statistics.
-
-
Constructor Detail
-
VarianceRatioCriterion
public VarianceRatioCriterion(NoiseHandling noiseOption, boolean penalize)
Constructor.- Parameters:
noiseOption
- 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:
- Variance Ratio Criteria
-
globalCentroid
public static int globalCentroid(Centroid overallCentroid, Relation<? extends NumberVector> rel, java.util.List<? extends Cluster<?>> clusters, NumberVector[] centroids, NoiseHandling noiseOption)
Update the global centroid.- Parameters:
overallCentroid
- Centroid to udpaterel
- Data relationclusters
- Clusterscentroids
- Cluster centroids- Returns:
- Number of clusters
-
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.
-
-