Class INFLO<O>

  • Type Parameters:
    O - the type of DatabaseObject the algorithm is applied on
    All Implemented Interfaces:
    elki.Algorithm, OutlierAlgorithm

    @Title("INFLO: Influenced Outlierness Factor")
    @Description("Ranking Outliers Using Symmetric Neigborhood Relationship")
    @Reference(authors="W. Jin, A. Tung, J. Han, W. Wang",
               title="Ranking outliers using symmetric neighborhood relationship",
               booktitle="Proc. 10th Pacific-Asia conference on Advances in Knowledge Discovery and Data Mining",
               url="https://doi.org/10.1007/11731139_68",
               bibkey="DBLP:conf/pakdd/JinTHW06")
    public class INFLO<O>
    extends java.lang.Object
    implements OutlierAlgorithm
    Influence Outliers using Symmetric Relationship (INFLO) using two-way search, is an outlier detection method based on LOF; but also using the reverse kNN.

    Reference:

    W. Jin, A. Tung, J. Han, W. Wang
    Ranking outliers using symmetric neighborhood relationship
    Proc. 10th Pacific-Asia conference on Advances in Knowledge Discovery and Data Mining, 2006.

    There is an error in the two-way search algorithm proposed in the article above. It does not correctly compute the RNN, but it will find only those RNN that are in the kNN, making the entire RNN computation redundant, as it uses the kNN + RNN later anyway.

    Given the errors in the INFLO paper, as of ELKI 0.8, we do:

    • Assume \( IS_k(p) := kNN(p) \cup RkNN(p) \)
    • Implement the pruning of two-way search, i.e., use INFLO=1 if \( |kNN(p) \cap RkNN(p)|\geq m\cdot |kNN(p)| \)
    Since:
    0.3
    Author:
    Ahmed Hettab, Erich Schubert
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  INFLO.Par<O>
      Parameterization class.
      • Nested classes/interfaces inherited from interface elki.Algorithm

        elki.Algorithm.Utils
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private elki.distance.Distance<? super O> distance
      Distance function used.
      private int kplus
      Number of neighbors to use.
      private static elki.logging.Logging LOG
      The logger for this class.
      private double m
      Pruning threshold m.
    • Constructor Summary

      Constructors 
      Constructor Description
      INFLO​(elki.distance.Distance<? super O> distance, double m, int k)
      Constructor with parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void computeINFLO​(elki.database.relation.Relation<O> relation, elki.database.ids.ModifiableDBIDs pruned, elki.database.query.knn.KNNSearcher<elki.database.ids.DBIDRef> knnq, elki.database.datastore.WritableDataStore<elki.database.ids.ModifiableDBIDs> rNNminuskNNs, elki.database.datastore.WritableDoubleDataStore inflos, elki.math.DoubleMinMax inflominmax)
      Compute the final INFLO scores.
      private void computeNeighborhoods​(elki.database.relation.Relation<O> relation, elki.database.datastore.DataStore<elki.database.ids.SetDBIDs> knns, elki.database.ids.ModifiableDBIDs pruned, elki.database.datastore.WritableDataStore<elki.database.ids.ModifiableDBIDs> rNNminuskNNs)
      Compute the reverse kNN minus the kNN.
      elki.data.type.TypeInformation[] getInputTypeRestriction()  
      OutlierResult run​(elki.database.relation.Relation<O> relation)
      Run the algorithm
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

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

        private elki.distance.Distance<? super O> distance
        Distance function used.
      • m

        private double m
        Pruning threshold m.
      • kplus

        private int kplus
        Number of neighbors to use.
    • Constructor Detail

      • INFLO

        public INFLO​(elki.distance.Distance<? super O> distance,
                     double m,
                     int k)
        Constructor with parameters.
        Parameters:
        distance - Distance function in use
        m - m Parameter
        k - k Parameter
    • Method Detail

      • getInputTypeRestriction

        public elki.data.type.TypeInformation[] getInputTypeRestriction()
        Specified by:
        getInputTypeRestriction in interface elki.Algorithm
      • run

        public OutlierResult run​(elki.database.relation.Relation<O> relation)
        Run the algorithm
        Parameters:
        relation - Relation to process
        Returns:
        Outlier result
      • computeNeighborhoods

        private void computeNeighborhoods​(elki.database.relation.Relation<O> relation,
                                          elki.database.datastore.DataStore<elki.database.ids.SetDBIDs> knns,
                                          elki.database.ids.ModifiableDBIDs pruned,
                                          elki.database.datastore.WritableDataStore<elki.database.ids.ModifiableDBIDs> rNNminuskNNs)
        Compute the reverse kNN minus the kNN.

        This is based on algorithm 2 (two-way search) from the INFLO paper, but unfortunately this algorithm does not compute the RkNN correctly, but rather \( RkNN \cap kNN \), which is quite useless given that we will use the union of that with kNN later on. Therefore, we decided to rather follow what appears to be the idea of the method, not the literal pseudocode included.

        Parameters:
        relation - Data relation
        knns - Stored nearest neighbors
        pruned - Pruned objects: with too many neighbors
        rNNminuskNNs - reverse kNN storage
      • computeINFLO

        protected void computeINFLO​(elki.database.relation.Relation<O> relation,
                                    elki.database.ids.ModifiableDBIDs pruned,
                                    elki.database.query.knn.KNNSearcher<elki.database.ids.DBIDRef> knnq,
                                    elki.database.datastore.WritableDataStore<elki.database.ids.ModifiableDBIDs> rNNminuskNNs,
                                    elki.database.datastore.WritableDoubleDataStore inflos,
                                    elki.math.DoubleMinMax inflominmax)
        Compute the final INFLO scores.
        Parameters:
        relation - Data relation
        pruned - Pruned objects
        knnq - kNN query
        rNNminuskNNs - reverse kNN storage
        inflos - INFLO score storage
        inflominmax - Output of minimum and maximum