Class FeatureBagging

  • All Implemented Interfaces:
    Algorithm, OutlierAlgorithm

    @Title("Feature Bagging for Outlier Detection")
    @Reference(authors="A. Lazarevic, V. Kumar",
               title="Feature Bagging for Outlier Detection",
               booktitle="Proc. 11th ACM SIGKDD Int. Conf. on Knowledge Discovery in Data Mining",
               url="https://doi.org/10.1145/1081870.1081891",
               bibkey="DBLP:conf/kdd/LazarevicK05")
    public class FeatureBagging
    extends java.lang.Object
    implements OutlierAlgorithm
    A simple ensemble method called "Feature bagging" for outlier detection.

    Since the proposed method is only sensible to run on multiple instances of the same algorithm (due to incompatible score ranges), we do not allow using arbitrary algorithms.

    Reference:
    A. Lazarevic, V. Kumar
    Feature Bagging for Outlier Detection
    Proc. 11th ACM SIGKDD Int. Conf. on Knowledge Discovery in Data Mining

    Since:
    0.4.0
    Author:
    Erich Schubert, Remigius Wojdanowski
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean breadth
      Cumulative sum or breadth first combinations.
      private int k
      The parameters k for LOF.
      private static Logging LOG
      The logger for this class.
      protected int num
      Number of instances to use.
      private RandomFactory rnd
      Random number generator for subspace choice.
    • Constructor Summary

      Constructors 
      Constructor Description
      FeatureBagging​(int k, int num, boolean breadth, RandomFactory rnd)
      Constructor.
    • Field Detail

      • LOG

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

        protected int num
        Number of instances to use.
      • breadth

        protected boolean breadth
        Cumulative sum or breadth first combinations.
      • rnd

        private RandomFactory rnd
        Random number generator for subspace choice.
      • k

        private int k
        The parameters k for LOF.
    • Constructor Detail

      • FeatureBagging

        public FeatureBagging​(int k,
                              int num,
                              boolean breadth,
                              RandomFactory rnd)
        Constructor.
        Parameters:
        k - k Parameter for LOF
        num - Number of subspaces to use
        breadth - Flag for breadth-first merging
        rnd - Random generator
    • 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<NumberVector> relation)
        Run the algorithm on a data set.
        Parameters:
        relation - Relation to use
        Returns:
        Outlier detection result
      • randomSubspace

        private long[] randomSubspace​(int alldim,
                                      int mindim,
                                      int maxdim,
                                      java.util.Random rand)
        Choose a random subspace.
        Parameters:
        alldim - Number of total dimensions
        mindim - Minimum number to choose
        maxdim - Maximum number to choose
        Returns:
        Subspace as bits.