Class SOD<V extends elki.data.NumberVector>

  • Type Parameters:
    V - the type of NumberVector handled by this Algorithm
    All Implemented Interfaces:
    elki.Algorithm, OutlierAlgorithm

    @Title("SOD: Subspace outlier degree")
    @Description("Outlier Detection in Axis-Parallel Subspaces of High Dimensional Data")
    @Reference(authors="Hans-Peter Kriegel, Peer Kr\u00f6ger, Erich Schubert, Arthur Zimek",
               title="Outlier Detection in Axis-Parallel Subspaces of High Dimensional Data",
               booktitle="Proc. Pacific-Asia Conf. on Knowledge Discovery and Data Mining (PAKDD 2009)",
               url="https://doi.org/10.1007/978-3-642-01307-2_86",
               bibkey="DBLP:conf/pakdd/KriegelKSZ09")
    public class SOD<V extends elki.data.NumberVector>
    extends java.lang.Object
    implements OutlierAlgorithm
    Subspace Outlier Degree: Outlier Detection in Axis-Parallel Subspaces of High Dimensional Data.

    Reference:

    Hans-Peter Kriegel, Peer Kröger, Erich Schubert, Arthur Zimek:
    Outlier Detection in Axis-Parallel Subspaces of High Dimensional Data
    Proc. Pacific-Asia Conf. on Knowledge Discovery and Data Mining (PAKDD 2009)

    Since:
    0.2
    Author:
    Arthur Zimek
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SOD.Par<V extends elki.data.NumberVector>
      Parameterization class.
      static class  SOD.SODModel
      SOD Model class
      • Nested classes/interfaces inherited from interface elki.Algorithm

        elki.Algorithm.Utils
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double alpha
      Alpha (discriminance value).
      private int knn
      Neighborhood size.
      private static elki.logging.Logging LOG
      The logger for this class.
      private boolean models
      Report models.
      private elki.similarity.Similarity<V> similarityFunction
      Similarity function to use.
    • Constructor Summary

      Constructors 
      Constructor Description
      SOD​(int knn, double alpha, elki.similarity.Similarity<V> similarityFunction, boolean models)
      Constructor with parameters.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static double[] computePerDimensionVariances​(elki.database.relation.Relation<? extends elki.data.NumberVector> relation, double[] center, elki.database.ids.DBIDs neighborhood)
      Compute the per-dimension variances for the given neighborhood and center.
      elki.data.type.TypeInformation[] getInputTypeRestriction()  
      private elki.database.ids.DBIDs getNearestNeighbors​(elki.database.relation.Relation<V> relation, elki.database.query.similarity.SimilarityQuery<V> simQ, elki.database.ids.DBIDRef queryObject)
      Get the k nearest neighbors in terms of the shared nearest neighbor distance.
      OutlierResult run​(elki.database.relation.Relation<V> relation)
      Performs the SOD algorithm on the given database.
      private double subspaceOutlierDegree​(V queryObject, double[] center, long[] weightVector)
      Compute SOD score.
      • 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.
      • knn

        private int knn
        Neighborhood size.
      • alpha

        private double alpha
        Alpha (discriminance value).
      • similarityFunction

        private elki.similarity.Similarity<V extends elki.data.NumberVector> similarityFunction
        Similarity function to use.
      • models

        private boolean models
        Report models.
    • Constructor Detail

      • SOD

        public SOD​(int knn,
                   double alpha,
                   elki.similarity.Similarity<V> similarityFunction,
                   boolean models)
        Constructor with parameters.
        Parameters:
        knn - knn value
        alpha - Alpha parameter
        similarityFunction - Shared nearest neighbor similarity function
        models - Report generated models
    • Method Detail

      • getInputTypeRestriction

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

        public OutlierResult run​(elki.database.relation.Relation<V> relation)
        Performs the SOD algorithm on the given database.
        Parameters:
        relation - Data relation to process
        Returns:
        Outlier result
      • getNearestNeighbors

        private elki.database.ids.DBIDs getNearestNeighbors​(elki.database.relation.Relation<V> relation,
                                                            elki.database.query.similarity.SimilarityQuery<V> simQ,
                                                            elki.database.ids.DBIDRef queryObject)
        Get the k nearest neighbors in terms of the shared nearest neighbor distance.

        The query object is excluded from the knn list.

        FIXME: move this to the database layer.

        Parameters:
        relation - the database holding the objects
        simQ - similarity function
        queryObject - the query object for which the kNNs should be determined
        Returns:
        the k nearest neighbors in terms of the shared nearest neighbor distance without the query object
      • computePerDimensionVariances

        private static double[] computePerDimensionVariances​(elki.database.relation.Relation<? extends elki.data.NumberVector> relation,
                                                             double[] center,
                                                             elki.database.ids.DBIDs neighborhood)
        Compute the per-dimension variances for the given neighborhood and center.
        Parameters:
        relation - Data relation
        center - Center vector
        neighborhood - Neighbors
        Returns:
        Per-dimension variances.
      • subspaceOutlierDegree

        private double subspaceOutlierDegree​(V queryObject,
                                             double[] center,
                                             long[] weightVector)
        Compute SOD score.
        Parameters:
        queryObject - Query object
        center - Center vector
        weightVector - Weight vector
        Returns:
        sod score