org.android.activityminer.logic.classification
Class NormalizerForDataPoints

Package class diagram package NormalizerForDataPoints
java.lang.Object
  extended by org.android.activityminer.logic.classification.NormalizerForDataPoints
All Implemented Interfaces:
Normalizer

public final class NormalizerForDataPoints
extends Object
implements Normalizer

Normalizer for Data points


Field Summary
private  int dimensions
          The point dimensions.
private  double[][] dimValueRanges
          The array with the cached value range information (minimum, maximum and range) per point dimension.
static int MAX
          Index of the value range maximum.
static int MIN
          Index of the value range minimum.
static int RANGE
          Index of the value range maximum.
 
Constructor Summary
NormalizerForDataPoints(int dimensions)
          Constructor
 
Method Summary
 double[] getRangeInfo(int idx)
          Getter for the range info of a given dimension index
private  void initializeValueRangeInfo(double[] point)
          Method to initialize the range information by a new data point.
 double[] normalize(double[] point)
          Point value normalization based on the stored range information.
private  double normalize(double value, int idx)
          Normalization of a single dimension value.
 void prepareWithTrainingData(Set<? extends Activity> trainingSet)
          Preparation with a training data set
 void setRangeInfo(int idx, double min, double max)
          Setter for the range info of a given dimension index
private  void updateValueRangeInfo(double[] point)
          Method to update the stored range information by a new data point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN

public static final int MIN
Index of the value range minimum.

See Also:
Constant Field Values

MAX

public static final int MAX
Index of the value range maximum.

See Also:
Constant Field Values

RANGE

public static final int RANGE
Index of the value range maximum.

See Also:
Constant Field Values

dimValueRanges

private final double[][] dimValueRanges
The array with the cached value range information (minimum, maximum and range) per point dimension.


dimensions

private final int dimensions
The point dimensions.

Constructor Detail

NormalizerForDataPoints

public NormalizerForDataPoints(int dimensions)
Constructor

Parameters:
dimensions - the point dimensions
Method Detail

normalize

public final double[] normalize(double[] point)
Description copied from interface: Normalizer
Point value normalization based on the stored range information.

Specified by:
normalize in interface Normalizer
Parameters:
point - the data point
Returns:
the normalized value

normalize

private final double normalize(double value,
                               int idx)
Normalization of a single dimension value.

Parameters:
value - the value
idx - the dimension index of the value
Returns:
the normalized value

getRangeInfo

public final double[] getRangeInfo(int idx)
Getter for the range info of a given dimension index

Parameters:
idx - the dimension index
Returns:
the normalized value

setRangeInfo

public final void setRangeInfo(int idx,
                               double min,
                               double max)
Setter for the range info of a given dimension index

Parameters:
idx - the dimension index
min - the minimum
max - the maximum

prepareWithTrainingData

public final void prepareWithTrainingData(Set<? extends Activity> trainingSet)
Description copied from interface: Normalizer
Preparation with a training data set

Specified by:
prepareWithTrainingData in interface Normalizer
Parameters:
trainingSet - the training data set

initializeValueRangeInfo

private void initializeValueRangeInfo(double[] point)
Method to initialize the range information by a new data point.

Parameters:
point - the new data point

updateValueRangeInfo

private final void updateValueRangeInfo(double[] point)
Method to update the stored range information by a new data point.

Parameters:
point - the new data point