Class AttributeWiseMADNormalization<V extends NumberVector>

  • Type Parameters:
    V - vector type
    All Implemented Interfaces:
    Normalization<V>, ObjectFilter

    public class AttributeWiseMADNormalization<V extends NumberVector>
    extends java.lang.Object
    implements Normalization<V>
    Median Absolute Deviation is used for scaling the data set as follows:

    First, the median, and median absolute deviation are computed in each axis. Then, each value is projected to (x - median(X)) / MAD(X).

    This is similar to z-standardization of data sets, except that it is more robust towards outliers, and only slightly more expensive to compute.

    Since:
    0.6.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected NumberVector.Factory<V> factory
      Number vector factory.
      private double[] imadsigma
      Stores the inverse median absolute deviation in each dimension.
      private static Logging LOG
      Class logger.
      private double[] median
      Stores the median in each dimension.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MultipleObjectsBundle filter​(MultipleObjectsBundle objects)
      Filter a set of object packages.
      private double normalize​(int d, double val)
      Normalize a single dimension.
      private double restore​(int d, double val)
      Restore a single dimension.
      V restore​(V featureVector)
      Transforms a feature vector to the original attribute ranges.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • LOG

        private static final Logging LOG
        Class logger.
      • median

        private double[] median
        Stores the median in each dimension.
      • imadsigma

        private double[] imadsigma
        Stores the inverse median absolute deviation in each dimension.
    • Constructor Detail

      • AttributeWiseMADNormalization

        public AttributeWiseMADNormalization()
        Constructor.
    • Method Detail

      • restore

        public V restore​(V featureVector)
                  throws NonNumericFeaturesException
        Description copied from interface: Normalization
        Transforms a feature vector to the original attribute ranges.
        Specified by:
        restore in interface Normalization<V extends NumberVector>
        Parameters:
        featureVector - a feature vector to be transformed into original space
        Returns:
        a feature vector transformed into original space corresponding to the given feature vector
        Throws:
        NonNumericFeaturesException - feature vector is not compatible with values initialized during normalization
      • normalize

        private double normalize​(int d,
                                 double val)
        Normalize a single dimension.
        Parameters:
        d - Dimension
        val - Value
        Returns:
        Normalized value
      • restore

        private double restore​(int d,
                               double val)
        Restore a single dimension.
        Parameters:
        d - Dimension
        val - Value
        Returns:
        Normalized value
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object