Class KNNDD<O>

  • Type Parameters:
    O - the type of objects processed by this algorithm
    All Implemented Interfaces:
    Algorithm, OutlierAlgorithm

    @Title("KNNDD: k-Nearest Neighbor Data Description")
    @Reference(authors="D. de Ridder, D. M. J. Tax, R. P. W. Duin",
               title="An experimental comparison of one-class classification methods",
               booktitle="Proc. 4th Ann. Conf. Advanced School for Computing and Imaging (ASCI\'98)",
               url="http://prlab.tudelft.nl/sites/default/files/asci_98.pdf",
               bibkey="conf/asci/deRidderTD98")
    public class KNNDD<O>
    extends java.lang.Object
    implements OutlierAlgorithm
    Nearest Neighbor Data Description.

    A variation inbetween of KNN outlier and LOF, comparing the nearest neighbor distance of a point to the nearest neighbor distance of the nearest neighbor.

    The initial description used k=1, where this equation makes most sense. For k > 1, one may want to use averaging similar to LOF.

    Reference ("1-Nearest-Neighbor method"):

    D. de Ridder, D. M. J. Tax, R. P. W. Duin
    An experimental comparison of one-class classification methods
    Proc. 4th Ann. Conf. Advanced School for Computing and Imaging (ASCI'98)

    Since:
    0.7.5
    Author:
    Erich Schubert
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  KNNDD.Par<O>
      Parameterization class.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Distance<? super O> distance
      Distance function used.
      protected int kplus
      The parameter k (plus query point!)
      private static Logging LOG
      The logger for this class.
    • Constructor Summary

      Constructors 
      Constructor Description
      KNNDD​(Distance<? super O> distance, int k)
      Constructor for a single kNN query.
    • 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
        The parameter k (plus query point!)
    • Constructor Detail

      • KNNDD

        public KNNDD​(Distance<? super O> distance,
                     int k)
        Constructor for a single kNN query.
        Parameters:
        distance - distance function to use
        k - Value of k (excluding query point!)
    • 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
        Returns:
        Type restriction
      • run

        public OutlierResult run​(Relation<O> relation)
        Runs the algorithm in the timed evaluation part.
        Parameters:
        relation - Data relation