public class EvaluateSquaredErrors extends java.lang.Object implements Evaluator
SquaredEuclideanDistanceFunction
only (when used with other distances, it will manually square the values; but
beware that the result is less meaningful with other distance functions).
For clusterings that provide a cluster prototype object (e.g. k-means), the prototype will be used. For other algorithms, the centroid will be recomputed.
TODO: support non-vector based clusterings, too, if the algorithm provided a prototype object (e.g. PAM).
TODO: when combined with k-means, detect if the distance functions agree (both should be using squared Euclidean), and reuse the SSQ values provided by k-means.
Modifier and Type | Class and Description |
---|---|
static class |
EvaluateSquaredErrors.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private NumberVectorDistanceFunction<?> |
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
Handling of Noise clusters
|
Constructor and Description |
---|
EvaluateSquaredErrors(NumberVectorDistanceFunction<?> distance,
NoiseHandling noiseOption)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
evaluateClustering(Database db,
Relation<? extends NumberVector> rel,
Clustering<?> c)
Evaluate a single clustering.
|
void |
processNewResult(ResultHierarchy hier,
Result result)
Process a result.
|
private static final Logging LOG
private NoiseHandling noiseOption
private NumberVectorDistanceFunction<?> distance
private java.lang.String key
public EvaluateSquaredErrors(NumberVectorDistanceFunction<?> distance, NoiseHandling noiseOption)
distance
- Distance function to use.noiseOption
- Control noise handling.public double evaluateClustering(Database db, Relation<? extends NumberVector> rel, Clustering<?> c)
db
- Databaserel
- Data relationc
- Clusteringpublic void processNewResult(ResultHierarchy hier, Result result)
ResultProcessor
processNewResult
in interface ResultProcessor
hier
- The base of the result tree.result
- Newly added result subtree.Copyright © 2019 ELKI Development Team. License information.