Package elki.outlier

Class DWOF<O>

  • Type Parameters:
    O - the type of objects handled by this algorithm
    All Implemented Interfaces:
    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)",
    public class DWOF<O>
    extends java.lang.Object
    implements OutlierAlgorithm
    Algorithm 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.


    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)

    Omar Yousry
    • Field Detail

      • LOG

        private static final Logging LOG
        The logger for this class.
      • distance

        protected Distance<? super O> distance
        Distance function used.
      • kplus

        protected int kplus
        Holds the value of DWOF.Par.K_ID i.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​(Distance<? super O> distance,
                    int k,
                    double delta)
        distance - Distance function to use in queries
        k - the value of k
        delta - Radius increase factor
    • Method Detail

      • getInputTypeRestriction

        public TypeInformation[] getInputTypeRestriction()
        Description copied from interface: Algorithm
        Get the input type restriction used for negotiating the data query.
        Specified by:
        getInputTypeRestriction in interface Algorithm
        Type restriction
      • run

        public OutlierResult run​(Relation<O> relation)
        Performs the Generalized DWOF_SCORE algorithm on the given database by calling all the other methods in the proper order.
        relation - Data to process
        new OutlierResult instance
      • initializeRadii

        private void initializeRadii​(DBIDs ids,
                                     KNNSearcher<DBIDRef> knnq,
                                     DistanceQuery<O> distFunc,
                                     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)
        ids - Database IDs to process
        distFunc - Distance function
        knnq - kNN search function
        radii - WritableDoubleDataStore to store radii
      • clusterData

        private void clusterData​(DBIDs ids,
                                 RangeSearcher<DBIDRef> rnnQuery,
                                 WritableDoubleDataStore radii,
                                 WritableDataStore<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
        ids - Database IDs to process
        rnnQuery - Data to process
        radii - Radii to cluster accordingly
        labels - Label storage.
      • updateSizes

        private int updateSizes​(DBIDs ids,
                                WritableDataStore<ModifiableDBIDs> labels,
                                WritableIntegerDataStore newSizes)
        This method updates each object's cluster size after the clustering step.
        ids - Object IDs to process
        labels - references for each object's cluster
        newSizes - the sizes container to be updated
        the number of unclustered objects