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.
|
ALGORITHM_ID
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(java.lang.Object ref,
java.lang.Object test)
Test whether two relation agree.
|
CollectionResult<double[]> |
run(Database database,
Relation<O> relation,
Relation<?> lrelation)
Run the algorithm
|
getDistanceFunction
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<double[]> 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(java.lang.Object ref, java.lang.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 © 2019 ELKI Development Team. License information.