edu.udo.cs.yale.generator
Class NormalizationGenerator

java.lang.Object
  extended by edu.udo.cs.yale.generator.FeatureGenerator
      extended by edu.udo.cs.yale.generator.SingularNumericalGenerator
          extended by edu.udo.cs.yale.generator.NormalizationGenerator

public class NormalizationGenerator
extends SingularNumericalGenerator

Creates the normalized value of all input attributes, i.e. calculates
(value - min) / (max - min) for normalization between 0 and 1 and (value - min) / (max - min) * (MAX - MIN) + MIN for normalization between MIN and MAX.

Version:
$Id: NormalizationGenerator.java,v 2.13 2006/03/21 15:35:40 ingomierswa Exp $
Author:
Simon Fischer, Ingo Mierswa

Field Summary
static java.lang.String FUNCTION_NAME
           
private  double max
           
private  double min
           
 
Fields inherited from class edu.udo.cs.yale.generator.FeatureGenerator
resultAttributes, SELECTION_MODE_ALL, SELECTION_MODE_RESTRICTIVE
 
Constructor Summary
NormalizationGenerator()
          Creates a new normalization generator.
NormalizationGenerator(double min, double max)
          Creates a new normalization operator which normalizes the values between min and max.
 
Method Summary
 double calculateValue(double value)
          Subclasses have to implement this method to calculate the function result.
 void generate(DataRow data)
          Generates the new attribute values for the example e and returns the new attribute values as doubles.
 java.lang.String getFunction()
          Sets the function name.
 FeatureGenerator newInstance()
          Subclasses must implement this method so that a new instance of this generator class is returned.
 void setFunction(java.lang.String name)
          Sets the function name.
 
Methods inherited from class edu.udo.cs.yale.generator.SingularNumericalGenerator
getInputAttributes, getInputCandidates, getOutputAttributes, toString
 
Methods inherited from class edu.udo.cs.yale.generator.FeatureGenerator
argumentsSet, checkCompatibility, createGeneratorForFunction, equals, generateAll, getArgument, getExampleTable, getSelectionMode, selectGenerator, setArguments, setExampleTable, setSelectionMode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FUNCTION_NAME

public static final java.lang.String FUNCTION_NAME
See Also:
Constant Field Values

min

private double min

max

private double max
Constructor Detail

NormalizationGenerator

public NormalizationGenerator()
Creates a new normalization generator. This generator normalizes the values between 0 and 1.


NormalizationGenerator

public NormalizationGenerator(double min,
                              double max)
Creates a new normalization operator which normalizes the values between min and max.

Method Detail

newInstance

public FeatureGenerator newInstance()
Description copied from class: FeatureGenerator
Subclasses must implement this method so that a new instance of this generator class is returned. The arguments and the example table will not be cloned and thus be null. This kind of clone is needed as generating algorithms must be able to clone generators form their pool without changing the arguments already set for the others.

Specified by:
newInstance in class FeatureGenerator


calculateValue

public double calculateValue(double value)
Description copied from class: SingularNumericalGenerator
Subclasses have to implement this method to calculate the function result.

Specified by:
calculateValue in class SingularNumericalGenerator


generate

public void generate(DataRow data)
              throws GenerationException
Description copied from class: FeatureGenerator
Generates the new attribute values for the example e and returns the new attribute values as doubles. e.getAttribute(getArgument(i)) is the correct way to access argument i. If the according attribute's type is VALUE_SERIES, the end index can be determined by i_end = getExampleTable().getBlockEndIndex(getArgument(i)). Thus all values of the series can be accessed using indices i through i_end.

Overrides:
generate in class SingularNumericalGenerator
Throws:
GenerationException


setFunction

public void setFunction(java.lang.String name)
Description copied from class: FeatureGenerator
Sets the function name. This method is only useful if subclasses can generate more than one function. (like the BasicArithmeticOperationGenerator).

Specified by:
setFunction in class FeatureGenerator


getFunction

public java.lang.String getFunction()
Description copied from class: FeatureGenerator
Sets the function name. This method is only useful if subclasses can generate more than one function. (like the BasicArithmeticOperationGenerator).

Specified by:
getFunction in class FeatureGenerator



Copyright © 2001-2006