Package elki.outlier.lof
Class LOF<O>
- java.lang.Object
-
- elki.outlier.lof.LOF<O>
-
- Type Parameters:
O- the type of data objects handled by this algorithm
- All Implemented Interfaces:
elki.Algorithm,OutlierAlgorithm
@Title("LOF: Local Outlier Factor") @Description("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") @Priority(200) public class LOF<O> extends java.lang.Object implements OutlierAlgorithmAlgorithm to compute density-based local outlier factors in a database based on a specified parameter-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)- Since:
- 0.2
- Author:
- Erich Schubert, Elke Achtert
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected doublecomputeLOFScore(elki.database.query.knn.KNNSearcher<elki.database.ids.DBIDRef> knnq, elki.database.ids.DBIDRef cur, elki.database.datastore.DoubleDataStore lrds)Compute a single LOF score.private voidcomputeLOFScores(elki.database.query.knn.KNNSearcher<elki.database.ids.DBIDRef> knnq, elki.database.ids.DBIDs ids, elki.database.datastore.DoubleDataStore lrds, elki.database.datastore.WritableDoubleDataStore lofs, elki.math.DoubleMinMax lofminmax)Compute local outlier factors.protected doublecomputeLRD(elki.database.query.knn.KNNSearcher<elki.database.ids.DBIDRef> knnq, elki.database.ids.DBIDIter curr)Compute a single local reachability distance.private voidcomputeLRDs(elki.database.query.knn.KNNSearcher<elki.database.ids.DBIDRef> knnq, elki.database.ids.DBIDs ids, elki.database.datastore.WritableDoubleDataStore lrds)Compute local reachability distances.elki.data.type.TypeInformation[]getInputTypeRestriction()OutlierResultrun(elki.database.relation.Relation<O> relation)Runs the LOF algorithm on the given database.-
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
The number of neighbors to query (plus the query point!)
-
-
Constructor Detail
-
LOF
public LOF(int k, elki.distance.Distance<? super O> distance)Constructor.- Parameters:
k- the number of neighbors to use for comparison (excluding the query point)distance- the neighborhood distance function
-
-
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 LOF algorithm on the given database.- Parameters:
relation- Data to process- Returns:
- LOF outlier result
-
computeLRDs
private void computeLRDs(elki.database.query.knn.KNNSearcher<elki.database.ids.DBIDRef> knnq, elki.database.ids.DBIDs ids, elki.database.datastore.WritableDoubleDataStore lrds)Compute local reachability distances.- Parameters:
knnq- KNN queryids- IDs to processlrds- Reachability storage
-
computeLRD
protected double computeLRD(elki.database.query.knn.KNNSearcher<elki.database.ids.DBIDRef> knnq, elki.database.ids.DBIDIter curr)Compute a single local reachability distance.- Parameters:
knnq- kNN Querycurr- Current object- Returns:
- Local Reachability Density
-
computeLOFScores
private void computeLOFScores(elki.database.query.knn.KNNSearcher<elki.database.ids.DBIDRef> knnq, elki.database.ids.DBIDs ids, elki.database.datastore.DoubleDataStore lrds, elki.database.datastore.WritableDoubleDataStore lofs, elki.math.DoubleMinMax lofminmax)Compute local outlier factors.- Parameters:
knnq- KNN queryids- IDs to processlrds- Local reachability distanceslofs- Local outlier factor storagelofminmax- Score minimum/maximum tracker
-
computeLOFScore
protected double computeLOFScore(elki.database.query.knn.KNNSearcher<elki.database.ids.DBIDRef> knnq, elki.database.ids.DBIDRef cur, elki.database.datastore.DoubleDataStore lrds)Compute a single LOF score.- Parameters:
knnq- kNN querycur- Current objectlrds- Stored reachability densities- Returns:
- LOF score.
-
-