O
- Object typepublic class AveragePrecisionAtK<O> extends AbstractDistanceBasedAlgorithm<O,CollectionResult<DoubleVector>>
Modifier and Type | Class and Description |
---|---|
static class |
AveragePrecisionAtK.Parameterizer<O>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
includeSelf
Include query object in evaluation.
|
private int |
k
The parameter k - the number of neighbors to retrieve.
|
private static Logging |
LOG
The logger for this class.
|
private RandomFactory |
random
Random sampling seed.
|
private double |
sampling
Relative number of object to use in sampling.
|
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
AveragePrecisionAtK(DistanceFunction<? super O> distanceFunction,
int k,
double sampling,
RandomFactory random,
boolean includeSelf)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
CollectionResult<DoubleVector> |
run(Database database,
Relation<O> relation,
Relation<?> lrelation)
Run the algorithm
|
getDistanceFunction
makeParameterDistanceFunction, run
private static final Logging LOG
private int k
private double sampling
private RandomFactory random
private boolean includeSelf
public AveragePrecisionAtK(DistanceFunction<? super O> distanceFunction, int k, double sampling, RandomFactory random, boolean includeSelf)
distanceFunction
- Distance functionk
- K parametersampling
- Sampling raterandom
- Random sampling generatorincludeSelf
- Include query object in evaluationpublic CollectionResult<DoubleVector> 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 matchpublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<CollectionResult<DoubleVector>>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<CollectionResult<DoubleVector>>
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.