O
- the type of objects handled by this algorithm@Title(value="KNNWeight outlier detection") @Description(value="Outlier detection based on the sum of distances of an object to its k nearest neighbors.") @Reference(authors="F. Angiulli, C. Pizzuti", title="Fast Outlier Detection in High Dimensional Spaces", booktitle="Proc. European Conf. Principles of Knowledge Discovery and Data Mining (PKDD\'02)", url="https://doi.org/10.1007/3-540-45681-3_2", bibkey="DBLP:conf/pkdd/AngiulliP02") @Alias(value={"de.lmu.ifi.dbs.elki.algorithm.outlier.KNNWeightOutlier","knnw"}) public class KNNWeightOutlier<O> extends AbstractDistanceBasedAlgorithm<O,OutlierResult> implements OutlierAlgorithm
As in the original publication (as far as we could tell from the pseudocode included), the current point is not included in the nearest neighbors (see figures in the publication). This matches the intuition common in nearest neighbor classification, where the evaluated instances are not part of the training set; but it contrasts to the pseudocode of the kNN outlier method and the database interpretation (which returns all objects stored in the database).
Furthermore, we report the sum of the k distances (called "weight" in the original publication). Other implementations may return the average distance instead, and therefore yield different results.
Reference:
F. Angiulli, C. Pizzuti
Fast Outlier Detection in High Dimensional Spaces
Proc. European Conf. Principles of Knowledge Discovery and Data Mining
(PKDD'02)
Modifier and Type | Class and Description |
---|---|
static class |
KNNWeightOutlier.Parameterizer<O>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private int |
k
Holds the number of nearest neighbors to query (excluding the query point!)
|
private static Logging |
LOG
The logger for this class.
|
ALGORITHM_ID
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
KNNWeightOutlier(DistanceFunction<? super O> distanceFunction,
int k)
Constructor with parameters.
|
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.
|
OutlierResult |
run(Database database,
Relation<O> relation)
Runs the algorithm in the timed evaluation part.
|
getDistanceFunction
run
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
run
private static final Logging LOG
private int k
public KNNWeightOutlier(DistanceFunction<? super O> distanceFunction, int k)
distanceFunction
- Distance functionk
- k Parameter (not including query point!)public OutlierResult run(Database database, Relation<O> relation)
database
- Database contextrelation
- Data relationpublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<OutlierResult>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<OutlierResult>
Copyright © 2019 ELKI Development Team. License information.