O
- Object typepublic class EvaluateRetrievalPerformance<O> extends AbstractDistanceBasedAlgorithm<O,EvaluateRetrievalPerformance.RetrievalPerformanceResult>
Modifier and Type | Class and Description |
---|---|
static class |
EvaluateRetrievalPerformance.KNNEvaluator
Evaluate kNN retrieval performance.
|
static class |
EvaluateRetrievalPerformance.Parameterizer<O>
Parameterization class.
|
static class |
EvaluateRetrievalPerformance.RetrievalPerformanceResult
Result object for MAP scores.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
includeSelf
Include query object in evaluation.
|
private static Logging |
LOG
The logger for this class.
|
private int |
maxk
K nearest neighbors to use for classification evaluation.
|
private String |
PREFIX
Prefix for statistics.
|
private RandomFactory |
random
Random sampling seed.
|
private double |
sampling
Relative number of object to use in sampling.
|
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
EvaluateRetrievalPerformance(DistanceFunction<? super O> distanceFunction,
double sampling,
RandomFactory random,
boolean includeSelf,
int maxk)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
computeDistances(ModifiableDoubleDBIDList nlist,
DBIDIter query,
DistanceQuery<O> distQuery,
Relation<O> relation)
Compute the distances to the neighbor objects.
|
private void |
findMatches(ModifiableDBIDs posn,
Relation<?> lrelation,
Object label)
Find all matching objects.
|
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
protected Logging |
getLogger()
Get the (STATIC) logger for this class.
|
protected static boolean |
match(Object ref,
Object test)
Test whether two relation agree.
|
EvaluateRetrievalPerformance.RetrievalPerformanceResult |
run(Database database,
Relation<O> relation,
Relation<?> lrelation)
Run the algorithm
|
getDistanceFunction
makeParameterDistanceFunction, run
private static final Logging LOG
private double sampling
private RandomFactory random
private boolean includeSelf
private final String PREFIX
private int maxk
public EvaluateRetrievalPerformance(DistanceFunction<? super O> distanceFunction, double sampling, RandomFactory random, boolean includeSelf, int maxk)
distanceFunction
- Distance functionsampling
- Sampling raterandom
- Random sampling generatorincludeSelf
- Include query object in evaluationmaxk
- Maximum k for kNN evaluationpublic EvaluateRetrievalPerformance.RetrievalPerformanceResult run(Database database, Relation<O> relation, Relation<?> lrelation)
database
- Database to run on (for kNN queries)relation
- Relation for distance computationslrelation
- Relation for class label comparisonprotected static boolean match(Object ref, Object test)
ref
- Reference objecttest
- Test objecttrue
if the objects matchprivate void findMatches(ModifiableDBIDs posn, Relation<?> lrelation, Object label)
posn
- Output set.lrelation
- Label relationlabel
- Query object labelprivate void computeDistances(ModifiableDoubleDBIDList nlist, DBIDIter query, DistanceQuery<O> distQuery, Relation<O> relation)
nlist
- Neighbor list (output)query
- Query objectdistQuery
- Distance functionrelation
- Data relationpublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<EvaluateRetrievalPerformance.RetrievalPerformanceResult>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<EvaluateRetrievalPerformance.RetrievalPerformanceResult>
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.