O
- the type of data objects handled by this algorithm@Title(value="LOF: Local Outlier Factor") @Description(value="Algorithm to compute density-based local outlier factors in a database based on the neighborhood size parameter \'k\'") @Reference(authors="Markus M. Breunig, Hans-Peter Kriegel, Raymond Ng, J\u00f6rg Sander", title="LOF: Identifying Density-Based Local Outliers", booktitle="Proc. 2nd ACM SIGMOD Int. Conf. on Management of Data (SIGMOD\'00)", url="https://doi.org/10.1145/342009.335388", bibkey="DBLP:conf/sigmod/BreunigKNS00") @Alias(value="de.lmu.ifi.dbs.elki.algorithm.outlier.LOF") @Priority(value=200) public class LOF<O> extends AbstractDistanceBasedAlgorithm<O,OutlierResult> implements OutlierAlgorithm
-lof.k
.
The original LOF parameter was called "minPts", but for consistency within ELKI we have renamed this parameter to "k".
Compatibility note: as of ELKI 0.7.0, we no longer include the query point, for consistency with other methods.
Reference:
Markus M. Breunig, Hans-Peter Kriegel, Raymond Ng, Jörg Sander
LOF: Identifying Density-Based Local Outliers
Proc. 2nd ACM SIGMOD Int. Conf. on Management of Data (SIGMOD'00)
Modifier and Type | Class and Description |
---|---|
static class |
LOF.Parameterizer<O>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
protected int |
k
The number of neighbors to query (including the query point!)
|
private static Logging |
LOG
The logger for this class.
|
ALGORITHM_ID
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
LOF(int k,
DistanceFunction<? super O> distanceFunction)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected double |
computeLOFScore(KNNQuery<O> knnq,
DBIDRef cur,
DoubleDataStore lrds)
Compute a single LOF score.
|
private void |
computeLOFScores(KNNQuery<O> knnq,
DBIDs ids,
DoubleDataStore lrds,
WritableDoubleDataStore lofs,
DoubleMinMax lofminmax)
Compute local outlier factors.
|
protected double |
computeLRD(KNNQuery<O> knnq,
DBIDIter curr)
Compute a single local reachability distance.
|
private void |
computeLRDs(KNNQuery<O> knnq,
DBIDs ids,
WritableDoubleDataStore lrds)
Compute local reachability distances.
|
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 LOF algorithm on the given database.
|
getDistanceFunction
run
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
run
private static final Logging LOG
protected int k
public LOF(int k, DistanceFunction<? super O> distanceFunction)
k
- the number of neighbors to use for comparison (excluding the query
point)distanceFunction
- the neighborhood distance functionpublic OutlierResult run(Database database, Relation<O> relation)
database
- Database to queryrelation
- Data to processprivate void computeLRDs(KNNQuery<O> knnq, DBIDs ids, WritableDoubleDataStore lrds)
knnq
- KNN queryids
- IDs to processlrds
- Reachability storageprotected double computeLRD(KNNQuery<O> knnq, DBIDIter curr)
knnq
- kNN Querycurr
- Current objectprivate void computeLOFScores(KNNQuery<O> knnq, DBIDs ids, DoubleDataStore lrds, WritableDoubleDataStore lofs, DoubleMinMax lofminmax)
knnq
- KNN queryids
- IDs to processlrds
- Local reachability distanceslofs
- Local outlier factor storagelofminmax
- Score minimum/maximum trackerprotected double computeLOFScore(KNNQuery<O> knnq, DBIDRef cur, DoubleDataStore lrds)
knnq
- kNN querycur
- Current objectlrds
- Stored reachability densitiespublic 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.