Package elki.algorithm.statistics
Class EvaluateRetrievalPerformance.KNNEvaluator
- java.lang.Object
-
- elki.algorithm.statistics.EvaluateRetrievalPerformance.KNNEvaluator
-
- Enclosing class:
- EvaluateRetrievalPerformance<O>
public static class EvaluateRetrievalPerformance.KNNEvaluator extends java.lang.Object
Evaluate kNN retrieval performance.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description static EvaluateRetrievalPerformance.KNNEvaluator
STATIC
Static instance.
-
Constructor Summary
Constructors Constructor Description KNNEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
countkNN(it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<java.lang.Object> counters, java.lang.Object l)
Counting helper for kNN classification.void
evaluateKNN(double[] knnperf, ModifiableDoubleDBIDList nlist, Relation<?> lrelation, it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<java.lang.Object> counters, java.lang.Object label)
Evaluate by simulating kNN classification for k=1...maxk
-
-
-
Field Detail
-
STATIC
public static final EvaluateRetrievalPerformance.KNNEvaluator STATIC
Static instance.
-
-
Method Detail
-
evaluateKNN
public void evaluateKNN(double[] knnperf, ModifiableDoubleDBIDList nlist, Relation<?> lrelation, it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<java.lang.Object> counters, java.lang.Object label)
Evaluate by simulating kNN classification for k=1...maxk- Parameters:
knnperf
- Output data storagenlist
- Neighbor listlrelation
- Label relationcounters
- (Reused) map for counting the class occurrences.label
- Label(s) of query object
-
countkNN
public int countkNN(it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<java.lang.Object> counters, java.lang.Object l)
Counting helper for kNN classification.- Parameters:
counters
- Counter storagel
- Object labels- Returns:
- Maximum count
-
-