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="M. M. Breunig, H.-P. Kriegel, R. Ng, and J. Sander", title="LOF: Identifying Density-Based Local Outliers", booktitle="Proc. 2nd ACM SIGMOD Int. Conf. on Management of Data (SIGMOD \'00), Dallas, TX, 2000", url="http://dx.doi.org/10.1145/342009.335388") @Alias(value={"de.lmu.ifi.dbs.elki.algorithm.outlier.LOF","LOF"}) public class LOF<O> extends AbstractDistanceBasedAlgorithm<O,OutlierResult> implements OutlierAlgorithm
Algorithm to compute density-based local outlier factors in a database based
on a specified parameter LOF.Parameterizer.K_ID
(-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:
M. M. Breunig, H.-P. Kriegel, R. Ng, J. Sander:
LOF: Identifying Density-Based Local Outliers.
In: Proc. 2nd ACM SIGMOD Int. Conf. on Management of Data (SIGMOD'00),
Dallas, TX, 2000.
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.
|
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
makeParameterDistanceFunction, 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 © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.