
V - Vector typeD - Distance typepublic class AveragePrecisionAtK<V,D extends NumberDistance<D,?>> extends AbstractDistanceBasedAlgorithm<V,D,CollectionResult<DoubleVector>>
| Modifier and Type | Class and Description |
|---|---|
static class |
AveragePrecisionAtK.Parameterizer<V extends NumberVector<?>,D extends NumberDistance<D,?>>
Parameterization class.
|
| Modifier and Type | Field and Description |
|---|---|
private int |
k
The parameter k - the number of neighbors to retrieve.
|
private static Logging |
LOG
The logger for this class.
|
private double |
sampling
Relative number of object to use in sampling.
|
private Long |
seed
Random sampling seed.
|
DISTANCE_FUNCTION_ID| Constructor and Description |
|---|
AveragePrecisionAtK(DistanceFunction<? super V,D> distanceFunction,
int k,
double sampling,
Long seed)
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.
|
HistogramResult<DoubleVector> |
run(Database database)
Runs the algorithm.
|
getDistanceFunctionmakeParameterDistanceFunctionprivate static final Logging LOG
private int k
private double sampling
private Long seed
public AveragePrecisionAtK(DistanceFunction<? super V,D> distanceFunction, int k, double sampling, Long seed)
distanceFunction - Distance functionk - K parametersampling - Sampling rateseed - Random sampling seed (may be null)public HistogramResult<DoubleVector> run(Database database)
Algorithmrun in interface Algorithmrun in class AbstractAlgorithm<CollectionResult<DoubleVector>>database - the database to run the algorithm onpublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithmgetInputTypeRestriction in interface AlgorithmgetInputTypeRestriction in class AbstractAlgorithm<CollectionResult<DoubleVector>>protected Logging getLogger()
AbstractAlgorithmgetLogger in class AbstractAlgorithm<CollectionResult<DoubleVector>>