O
- the type of objects handled by this algorithm@Title(value="KNN outlier: Efficient Algorithms for Mining Outliers from Large Data Sets") @Description(value="Outlier Detection based on the distance of an object to its k nearest neighbor.") @Reference(authors="S. Ramaswamy, R. Rastogi, K. Shim", title="Efficient Algorithms for Mining Outliers from Large Data Sets", booktitle="Proc. Int. Conf. on Management of Data (SIGMOD 2000)", url="https://doi.org/10.1145/342009.335437", bibkey="DBLP:conf/sigmod/RamaswamyRS00") @Alias(value={"de.lmu.ifi.dbs.elki.algorithm.outlier.KNNOutlier","knno"}) @Priority(value=200) public class KNNOutlier<O> extends AbstractDistanceBasedAlgorithm<O,OutlierResult> implements OutlierAlgorithm
This implementation differs from the original pseudocode: the k nearest neighbors do not exclude the point that is currently evaluated. I.e. for k=1 the resulting score is the distance to the 1-nearest neighbor that is not the query point and therefore should match k=2 in the exact pseudocode - a value of k=1 in the original code does not make sense, as the 1NN distance will be 0 for every point in the database. If you for any reason want to use the original algorithm, subtract 1 from the k parameter.
Reference:
S. Ramaswamy, R. Rastogi, K. Shim
Efficient Algorithms for Mining Outliers from Large Data Sets.
In: Proc. Int. Conf. on Management of Data (SIGMOD 2000)
Modifier and Type | Class and Description |
---|---|
static class |
KNNOutlier.Parameterizer<O>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private int |
k
The parameter k (including query point!)
|
private static Logging |
LOG
The logger for this class.
|
ALGORITHM_ID
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
KNNOutlier(DistanceFunction<? super O> distanceFunction,
int k)
Constructor for a single kNN query.
|
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.
|
OutlierResult |
run(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 KNNOutlier(DistanceFunction<? super O> distanceFunction, int k)
distanceFunction
- distance function to usek
- Value of k (excluding query point!)public OutlierResult run(Database database, Relation<O> relation)
database
- Database (no longer used)relation
- Data relationpublic OutlierResult run(Relation<O> relation)
relation
- 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.