Package elki.outlier
Class DWOF<O>
- java.lang.Object
-
- elki.outlier.DWOF<O>
-
- Type Parameters:
O- the type of objects handled by this algorithm
- All Implemented Interfaces:
elki.Algorithm,OutlierAlgorithm
@Title("DWOF: Dynamic Window Outlier Factor") @Description("Algorithm to compute dynamic-window outlier factors in a database based on the neighborhood size parameter \'k\'") @Reference(authors="R. Momtaz, N. Mohssen, M. A. Gowayyed", title="DWOF: A Robust Density-Based Outlier Detection Approach", booktitle="Proc. 6th Iberian Conf. Pattern Recognition and Image Analysis (IbPRIA 2013)", url="https://doi.org/10.1007/978-3-642-38628-2_61", bibkey="DBLP:conf/ibpria/MomtazMG13") public class DWOF<O> extends java.lang.Object implements OutlierAlgorithmAlgorithm to compute dynamic-window outlier factors in a database based on a specified parameter k, which specifies the number of the neighbors to be considered during the calculation of the DWOF score.Reference:
Rana Momtaz, Nesma Mohssen and Mohammad A. Gowayyed:
DWOF: A Robust Density-Based OutlierDetection Approach.
Proc. 6th Iberian Conf. Pattern Recognition and Image Analysis (IbPRIA 2013)- Since:
- 0.6.0
- Author:
- Omar Yousry
-
-
Field Summary
Fields Modifier and Type Field Description protected doubledeltaThe radii changing ratioprotected elki.distance.Distance<? super O>distanceDistance function used.protected intkplusHolds the value ofDWOF.Par.K_IDi.e.private static elki.logging.LoggingLOGThe logger for this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidclusterData(elki.database.ids.DBIDs ids, elki.database.query.range.RangeSearcher<elki.database.ids.DBIDRef> rnnQuery, elki.database.datastore.WritableDoubleDataStore radii, elki.database.datastore.WritableDataStore<elki.database.ids.ModifiableDBIDs> labels)This method applies a density based clustering algorithm.elki.data.type.TypeInformation[]getInputTypeRestriction()private voidinitializeRadii(elki.database.ids.DBIDs ids, elki.database.query.knn.KNNSearcher<elki.database.ids.DBIDRef> knnq, elki.database.query.distance.DistanceQuery<O> distFunc, elki.database.datastore.WritableDoubleDataStore radii)This method prepares a container for the radii of the objects and initializes radii according to the equation: initialRadii of a certain object = (absoluteMinDist of all objects) * (avgDist of the object) / (minAvgDist of all objects)OutlierResultrun(elki.database.relation.Relation<O> relation)Performs the Generalized DWOF_SCORE algorithm on the given database by calling all the other methods in the proper order.private intupdateSizes(elki.database.ids.DBIDs ids, elki.database.datastore.WritableDataStore<elki.database.ids.ModifiableDBIDs> labels, elki.database.datastore.WritableIntegerDataStore newSizes)This method updates each object's cluster size after the clustering step.-
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
Holds the value ofDWOF.Par.K_IDi.e. Number of neighbors to consider during the calculation of DWOF scores + the query point.
-
delta
protected double delta
The radii changing ratio
-
-
Constructor Detail
-
DWOF
public DWOF(elki.distance.Distance<? super O> distance, int k, double delta)
Constructor.- Parameters:
distance- Distance function to use in queriesk- the value of kdelta- Radius increase factor
-
-
Method Detail
-
getInputTypeRestriction
public elki.data.type.TypeInformation[] getInputTypeRestriction()
- Specified by:
getInputTypeRestrictionin interfaceelki.Algorithm
-
run
public OutlierResult run(elki.database.relation.Relation<O> relation)
Performs the Generalized DWOF_SCORE algorithm on the given database by calling all the other methods in the proper order.- Parameters:
relation- Data to process- Returns:
- new OutlierResult instance
-
initializeRadii
private void initializeRadii(elki.database.ids.DBIDs ids, elki.database.query.knn.KNNSearcher<elki.database.ids.DBIDRef> knnq, elki.database.query.distance.DistanceQuery<O> distFunc, elki.database.datastore.WritableDoubleDataStore radii)This method prepares a container for the radii of the objects and initializes radii according to the equation: initialRadii of a certain object = (absoluteMinDist of all objects) * (avgDist of the object) / (minAvgDist of all objects)- Parameters:
ids- Database IDs to processdistFunc- Distance functionknnq- kNN search functionradii- WritableDoubleDataStore to store radii
-
clusterData
private void clusterData(elki.database.ids.DBIDs ids, elki.database.query.range.RangeSearcher<elki.database.ids.DBIDRef> rnnQuery, elki.database.datastore.WritableDoubleDataStore radii, elki.database.datastore.WritableDataStore<elki.database.ids.ModifiableDBIDs> labels)This method applies a density based clustering algorithm. It looks for an unclustered object and builds a new cluster for it, then adds all the points within its radius to that cluster. nChain represents the points to be added to the cluster and its radius-neighbors- Parameters:
ids- Database IDs to processrnnQuery- Data to processradii- Radii to cluster accordinglylabels- Label storage.
-
updateSizes
private int updateSizes(elki.database.ids.DBIDs ids, elki.database.datastore.WritableDataStore<elki.database.ids.ModifiableDBIDs> labels, elki.database.datastore.WritableIntegerDataStore newSizes)This method updates each object's cluster size after the clustering step.- Parameters:
ids- Object IDs to processlabels- references for each object's clusternewSizes- the sizes container to be updated- Returns:
- the number of unclustered objects
-
-