Class KNNWeightOutlier<O>
- java.lang.Object
-
- elki.outlier.distance.KNNWeightOutlier<O>
-
- Type Parameters:
O- the type of objects handled by this algorithm
- All Implemented Interfaces:
elki.Algorithm,OutlierAlgorithm
@Title("KNNWeight outlier detection") @Description("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("knnw") public class KNNWeightOutlier<O> extends java.lang.Object implements OutlierAlgorithmOutlier Detection based on the accumulated distances of a point to its k nearest neighbors.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)- Since:
- 0.3
- Author:
- Lisa Reichert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKNNWeightOutlier.Par<O>Parameterization class.
-
Constructor Summary
Constructors Constructor Description KNNWeightOutlier(elki.distance.Distance<? super O> distance, int k)Constructor with parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description elki.data.type.TypeInformation[]getInputTypeRestriction()OutlierResultrun(elki.database.relation.Relation<O> relation)Runs the algorithm in the timed evaluation part.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.outlier.OutlierAlgorithm
autorun
-
-
-
-
Field Detail
-
LOG
private static final elki.logging.Logging LOG
The logger for this class.
-
distance
protected elki.distance.Distance<? super O> distance
Distance function used.
-
kplus
protected int kplus
Holds the number of nearest neighbors to query (plus the query point!)
-
-
Constructor Detail
-
KNNWeightOutlier
public KNNWeightOutlier(elki.distance.Distance<? super O> distance, int k)
Constructor with parameters.- Parameters:
distance- Distance functionk- k parameter (not including query point!)
-
-
Method Detail
-
getInputTypeRestriction
public elki.data.type.TypeInformation[] getInputTypeRestriction()
- Specified by:
getInputTypeRestrictionin interfaceelki.Algorithm
-
run
public OutlierResult run(elki.database.relation.Relation<O> relation)
Runs the algorithm in the timed evaluation part.- Parameters:
relation- Data relation
-
-