O
- the type of DatabaseObjects handled by this AlgorithmD
- Distance type@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","outlier.LOF","LOF"}) public class LOF<O,D extends NumberDistance<D,?>> extends AbstractDistanceBasedAlgorithm<O,D,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".
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,D extends NumberDistance<D,?>>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
protected int |
k
Holds the value of
LOF.Parameterizer.K_ID . |
private static Logging |
LOG
The logger for this class.
|
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
LOF(int k,
DistanceFunction<? super O,D> distanceFunction)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
computeLOFScores(KNNQuery<O,D> knnq,
DBIDs ids,
DoubleDataStore lrds,
WritableDoubleDataStore lofs,
DoubleMinMax lofminmax)
Compute local outlier factors.
|
private void |
computeLRDs(KNNQuery<O,D> 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)
Performs the Generalized LOF_SCORE 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
LOF.Parameterizer.K_ID
.public LOF(int k, DistanceFunction<? super O,D> distanceFunction)
k
- the value of kdistanceFunction
- the neighborhood distance functionpublic OutlierResult run(Database database, Relation<O> relation)
database
- Database to queryrelation
- Data to processprivate void computeLRDs(KNNQuery<O,D> knnq, DBIDs ids, WritableDoubleDataStore lrds)
knnq
- KNN queryids
- IDs to processlrds
- Reachability storageprivate void computeLOFScores(KNNQuery<O,D> 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 trackerpublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<OutlierResult>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<OutlierResult>