Class AttributeWiseMADNormalization<V extends NumberVector>
- java.lang.Object
-
- elki.datasource.filter.normalization.columnwise.AttributeWiseMADNormalization<V>
-
- 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.
-
Constructor Summary
Constructors Constructor Description AttributeWiseMADNormalization()
Constructor.
-
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
-
Methods inherited from interface elki.datasource.filter.normalization.Normalization
transform
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger.
-
factory
protected NumberVector.Factory<V extends NumberVector> factory
Number vector factory.
-
median
private double[] median
Stores the median in each dimension.
-
imadsigma
private double[] imadsigma
Stores the inverse median absolute deviation in each dimension.
-
-
Method Detail
-
filter
public MultipleObjectsBundle filter(MultipleObjectsBundle objects)
Description copied from interface:ObjectFilter
Filter a set of object packages.- Specified by:
filter
in interfaceObjectFilter
- Parameters:
objects
- Object to filter- Returns:
- Filtered objects
-
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 interfaceNormalization<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
- Dimensionval
- Value- Returns:
- Normalized value
-
restore
private double restore(int d, double val)
Restore a single dimension.- Parameters:
d
- Dimensionval
- Value- Returns:
- Normalized value
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-