Class AttributeWiseMinMaxNormalization<V extends NumberVector>
- java.lang.Object
-
- elki.datasource.filter.AbstractConversionFilter<I,O>
-
- elki.datasource.filter.AbstractVectorConversionFilter<V,V>
-
- elki.datasource.filter.normalization.columnwise.AttributeWiseMinMaxNormalization<V>
-
- Type Parameters:
V- vector type
- All Implemented Interfaces:
Normalization<V>,ObjectFilter
@Priority(200) @Alias({"norm","normalize","minmax"}) public class AttributeWiseMinMaxNormalization<V extends NumberVector> extends AbstractVectorConversionFilter<V,V> implements Normalization<V>
Class to perform and undo a normalization on real vectors with respect to a given minimum and maximum in each dimension. This class performs a linear scaling on the data.- Since:
- 0.4.0
- Author:
- Elke Achtert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAttributeWiseMinMaxNormalization.Par<V extends NumberVector>Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description private static double[]EMPTY_ARRAYEmpty double array.private static LoggingLOGClass logger.private double[]maximaStores the maximum in each dimension.private double[]minimaStores the minimum in each dimension.-
Fields inherited from class elki.datasource.filter.AbstractVectorConversionFilter
factory
-
-
Constructor Summary
Constructors Constructor Description AttributeWiseMinMaxNormalization()Constructor.AttributeWiseMinMaxNormalization(double[] minima, double[] maxima)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SimpleTypeInformation<? super V>convertedType(SimpleTypeInformation<V> in)Get the output type from the input type after conversion.private doublefactor(int dimension)Returns a factor for normalization in a certain dimension.protected VfilterSingleObject(V featureVector)Normalize a single instance.protected SimpleTypeInformation<? super V>getInputTypeRestriction()Get the input type restriction used for negotiating the data query.protected LogginggetLogger()Class logger.protected voidprepareProcessInstance(V featureVector)Process a single object during initialization.protected booleanprepareStart(SimpleTypeInformation<V> in)Return "true" when the normalization needs initialization (two-pass filtering!).Vrestore(V featureVector)Transforms a feature vector to the original attribute ranges.java.lang.StringtoString()LinearEquationSystemtransform(LinearEquationSystem linearEquationSystem)Transforms a linear equation system describing linear dependencies derived on the normalized space into a linear equation system describing linear dependencies quantitatively adapted to the original space.-
Methods inherited from class elki.datasource.filter.AbstractVectorConversionFilter
initializeOutputType
-
Methods inherited from class elki.datasource.filter.AbstractConversionFilter
filter, prepareComplete
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface elki.datasource.filter.ObjectFilter
filter
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger.
-
maxima
private double[] maxima
Stores the maximum in each dimension.
-
minima
private double[] minima
Stores the minimum in each dimension.
-
EMPTY_ARRAY
private static final double[] EMPTY_ARRAY
Empty double array.
-
-
Method Detail
-
prepareStart
protected boolean prepareStart(SimpleTypeInformation<V> in)
Description copied from class:AbstractConversionFilterReturn "true" when the normalization needs initialization (two-pass filtering!).- Overrides:
prepareStartin classAbstractConversionFilter<V extends NumberVector,V extends NumberVector>- Parameters:
in- Input type information- Returns:
- true or false
-
prepareProcessInstance
protected void prepareProcessInstance(V featureVector)
Description copied from class:AbstractConversionFilterProcess a single object during initialization.- Overrides:
prepareProcessInstancein classAbstractConversionFilter<V extends NumberVector,V extends NumberVector>- Parameters:
featureVector- Object to process
-
filterSingleObject
protected V filterSingleObject(V featureVector)
Description copied from class:AbstractConversionFilterNormalize a single instance. You can implement this as UnsupportedOperationException if you override both public "normalize" functions!- Specified by:
filterSingleObjectin classAbstractConversionFilter<V extends NumberVector,V extends NumberVector>- Parameters:
featureVector- Database object to normalize- Returns:
- Normalized database object
-
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 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
-
factor
private double factor(int dimension)
Returns a factor for normalization in a certain dimension. The provided factor is the maximum-minimum in the specified dimension, if these two values differ, otherwise it is the maximum if this value differs from 0, otherwise it is 1.- Parameters:
dimension- the dimension to get a factor for normalization- Returns:
- a factor for normalization in a certain dimension
-
transform
public LinearEquationSystem transform(LinearEquationSystem linearEquationSystem)
Description copied from interface:NormalizationTransforms a linear equation system describing linear dependencies derived on the normalized space into a linear equation system describing linear dependencies quantitatively adapted to the original space.- Specified by:
transformin interfaceNormalization<V extends NumberVector>- Parameters:
linearEquationSystem- the linear equation system to be transformed- Returns:
- a linear equation system describing linear dependencies derived on the normalized space transformed into a linear equation system describing linear dependencies quantitatively adapted to the original space
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractConversionFilter<V extends NumberVector,V extends NumberVector>
-
convertedType
protected SimpleTypeInformation<? super V> convertedType(SimpleTypeInformation<V> in)
Description copied from class:AbstractConversionFilterGet the output type from the input type after conversion.- Specified by:
convertedTypein classAbstractConversionFilter<V extends NumberVector,V extends NumberVector>- Parameters:
in- input type restriction- Returns:
- output type restriction
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractConversionFilterClass logger.- Specified by:
getLoggerin classAbstractConversionFilter<V extends NumberVector,V extends NumberVector>- Returns:
- Logger
-
getInputTypeRestriction
protected SimpleTypeInformation<? super V> getInputTypeRestriction()
Description copied from class:AbstractConversionFilterGet the input type restriction used for negotiating the data query.- Specified by:
getInputTypeRestrictionin classAbstractConversionFilter<V extends NumberVector,V extends NumberVector>- Returns:
- Type restriction
-
-