Package elki.outlier.lof
Class COF<O>
- java.lang.Object
-
- elki.outlier.lof.COF<O>
-
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
Algorithm
,OutlierAlgorithm
@Title("COF: Connectivity-based Outlier Factor") @Reference(authors="J. Tang, Z. Chen, A. W. C. Fu, D. W. Cheung", title="Enhancing effectiveness of outlier detections for low density patterns", booktitle="In Advances in Knowledge Discovery and Data Mining", url="https://doi.org/10.1007/3-540-47887-6_53", bibkey="DBLP:conf/pakdd/TangCFC02") public class COF<O> extends java.lang.Object implements OutlierAlgorithm
Connectivity-based Outlier Factor (COF).Reference:
J. Tang, Z. Chen, A. W. C. Fu, D. W. Cheung
Enhancing effectiveness of outlier detections for low density patterns.
Advances in Knowledge Discovery and Data Mining.- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface elki.Algorithm
Algorithm.Utils
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
computeAverageChainingDistances(KNNSearcher<DBIDRef> knnq, DistanceQuery<O> dq, DBIDs ids, WritableDoubleDataStore acds)
Computes the average chaining distance, the average length of a path through the given set of points to each target.private void
computeCOFScores(KNNSearcher<DBIDRef> knnq, DBIDs ids, DoubleDataStore acds, WritableDoubleDataStore cofs, DoubleMinMax cofminmax)
Compute Connectivity outlier factors.TypeInformation[]
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.OutlierResult
run(Relation<O> relation)
Runs the COF 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
-
-
-
-
Method Detail
-
run
public OutlierResult run(Relation<O> relation)
Runs the COF algorithm on the given database.- Parameters:
relation
- Data to process- Returns:
- COF outlier result
-
computeAverageChainingDistances
protected void computeAverageChainingDistances(KNNSearcher<DBIDRef> knnq, DistanceQuery<O> dq, DBIDs ids, WritableDoubleDataStore acds)
Computes the average chaining distance, the average length of a path through the given set of points to each target. The authors of COF decided to approximate this value using a weighted mean that assumes every object is reached from the previous point (but actually every point could be best reachable from the first, in which case this does not make much sense.)TODO: can we accelerate this by using the kNN of the neighbors?
- Parameters:
knnq
- KNN querydq
- Distance queryids
- IDs to processacds
- Storage for average chaining distances
-
computeCOFScores
private void computeCOFScores(KNNSearcher<DBIDRef> knnq, DBIDs ids, DoubleDataStore acds, WritableDoubleDataStore cofs, DoubleMinMax cofminmax)
Compute Connectivity outlier factors.- Parameters:
knnq
- KNN queryids
- IDs to processacds
- Average chaining distancescofs
- Connectivity outlier factor storagecofminmax
- Score minimum/maximum tracker
-
getInputTypeRestriction
public TypeInformation[] getInputTypeRestriction()
Description copied from interface:Algorithm
Get the input type restriction used for negotiating the data query.- Specified by:
getInputTypeRestriction
in interfaceAlgorithm
- Returns:
- Type restriction
-
-