de.lmu.ifi.dbs.elki.datasource.filter
Class AttributeWiseMinMaxNormalization<V extends NumberVector<V,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.datasource.filter.AbstractConversionFilter<O,O>
      extended by de.lmu.ifi.dbs.elki.datasource.filter.AbstractNormalization<V>
          extended by de.lmu.ifi.dbs.elki.datasource.filter.AttributeWiseMinMaxNormalization<V>
Type Parameters:
V - vector type
All Implemented Interfaces:
Normalization<V>, ObjectFilter, InspectionUtilFrequentlyScanned, Parameterizable

public class AttributeWiseMinMaxNormalization<V extends NumberVector<V,?>>
extends AbstractNormalization<V>

Class to perform and undo a normalization on real vectors with respect to given minimum and maximum in each dimension.


Nested Class Summary
static class AttributeWiseMinMaxNormalization.Parameterizer<V extends NumberVector<V,?>>
          Parameterization class.
 
Field Summary
private  double[] maxima
          Stores the maximum in each dimension.
static OptionID MAXIMA_ID
          Parameter for maximum.
private  double[] minima
          Stores the minimum in each dimension.
static OptionID MINIMA_ID
          Parameter for minimum.
 
Constructor Summary
AttributeWiseMinMaxNormalization(double[] minima, double[] maxima)
          Constructor.
 
Method Summary
private  double factor(int dimension)
          Returns a factor for normalization in a certain dimension.
protected  V filterSingleObject(V featureVector)
          Normalize a single instance.
protected  SimpleTypeInformation<? super V> getInputTypeRestriction()
          Get the input type restriction used for negotiating the data query.
protected  void prepareProcessInstance(V featureVector)
          Process a single object during initialization.
protected  boolean prepareStart(SimpleTypeInformation<V> in)
          Return "true" when the normalization needs initialization (two-pass filtering!)
 V restore(V featureVector)
          Transforms a feature vector to the original attribute ranges.
 String toString()
           
 LinearEquationSystem transform(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 de.lmu.ifi.dbs.elki.datasource.filter.AbstractNormalization
convertedType, normalizeObjects
 
Methods inherited from class de.lmu.ifi.dbs.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 de.lmu.ifi.dbs.elki.datasource.filter.ObjectFilter
filter
 

Field Detail

MINIMA_ID

public static final OptionID MINIMA_ID
Parameter for minimum.


MAXIMA_ID

public static final OptionID MAXIMA_ID
Parameter for maximum.


maxima

private double[] maxima
Stores the maximum in each dimension.


minima

private double[] minima
Stores the minimum in each dimension.

Constructor Detail

AttributeWiseMinMaxNormalization

public AttributeWiseMinMaxNormalization(double[] minima,
                                        double[] maxima)
Constructor.

Parameters:
minima - Minimum values
maxima - Maximum values
Method Detail

prepareStart

protected boolean prepareStart(SimpleTypeInformation<V> in)
Description copied from class: AbstractConversionFilter
Return "true" when the normalization needs initialization (two-pass filtering!)

Overrides:
prepareStart in class AbstractConversionFilter<V extends NumberVector<V,?>,V extends NumberVector<V,?>>
Parameters:
in - Input type information
Returns:
true or false

prepareProcessInstance

protected void prepareProcessInstance(V featureVector)
Description copied from class: AbstractConversionFilter
Process a single object during initialization.

Overrides:
prepareProcessInstance in class AbstractConversionFilter<V extends NumberVector<V,?>,V extends NumberVector<V,?>>
Parameters:
featureVector - Object to process

filterSingleObject

protected V filterSingleObject(V featureVector)
Description copied from class: AbstractConversionFilter
Normalize a single instance. You can implement this as UnsupportedOperationException if you override both public "normalize" functions!

Specified by:
filterSingleObject in class AbstractConversionFilter<V extends NumberVector<V,?>,V extends NumberVector<V,?>>
Parameters:
featureVector - Database object to normalize
Returns:
Normalized database object

restore

public V restore(V featureVector)
                                    throws NonNumericFeaturesException
Description copied from interface: Normalization
Transforms a feature vector to the original attribute ranges.

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: Normalization
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.

Specified by:
transform in interface Normalization<V extends NumberVector<V,?>>
Overrides:
transform in class AbstractNormalization<V extends NumberVector<V,?>>
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 String toString()
Overrides:
toString in class AbstractNormalization<V extends NumberVector<V,?>>

getInputTypeRestriction

protected SimpleTypeInformation<? super V> getInputTypeRestriction()
Description copied from class: AbstractConversionFilter
Get the input type restriction used for negotiating the data query.

Specified by:
getInputTypeRestriction in class AbstractConversionFilter<V extends NumberVector<V,?>,V extends NumberVector<V,?>>
Returns:
Type restriction

Release 0.4.0 (2011-09-20_1324)