Class AttributeWiseMADNormalization<V extends elki.data.NumberVector>
- java.lang.Object
-
- elki.datasource.filter.normalization.columnwise.AttributeWiseMADNormalization<V>
-
- Type Parameters:
V- vector type
- All Implemented Interfaces:
Normalization<V>,elki.datasource.filter.ObjectFilter
public class AttributeWiseMADNormalization<V extends elki.data.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 elki.data.NumberVector.Factory<V>factoryNumber vector factory.private double[]imadsigmaStores the inverse median absolute deviation in each dimension.private static elki.logging.LoggingLOGClass logger.private double[]medianStores 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 elki.datasource.bundle.MultipleObjectsBundlefilter(elki.datasource.bundle.MultipleObjectsBundle objects)private doublenormalize(int d, double val)Normalize a single dimension.private doublerestore(int d, double val)Restore a single dimension.Vrestore(V featureVector)Transforms a feature vector to the original attribute ranges.java.lang.StringtoString()-
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 elki.logging.Logging LOG
Class logger.
-
factory
protected elki.data.NumberVector.Factory<V extends elki.data.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 elki.datasource.bundle.MultipleObjectsBundle filter(elki.datasource.bundle.MultipleObjectsBundle objects)
- Specified by:
filterin interfaceelki.datasource.filter.ObjectFilter
-
restore
public V restore(V featureVector) throws NonNumericFeaturesException
Description copied from interface:NormalizationTransforms a feature vector to the original attribute ranges.- Specified by:
restorein interfaceNormalization<V extends elki.data.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:
toStringin classjava.lang.Object
-
-