geneticWedge.gp.io
Class NumericData

java.lang.Object
  extended by geneticWedge.gp.io.NumericData

public class NumericData
extends java.lang.Object

This class holds numeric data as well as variable names and data labels. It can perform operations on the data that it holds, such as normalisation


Constructor Summary
NumericData(java.lang.String[] names, double[][] data, java.lang.String[] labels)
          constructs a NumericData object with data, variable names and data labels.
 
Method Summary
 double[][] denormaliseData(double[][] normData)
          This method uses the normalisation constants set as a side effect in normaliseData().
 double[] denormaliseData(double[] normData, int index)
          This method uses the normalisation constants set as a side effect in normaliseData().
 double[][] getData()
          Returns the data held by this NumericData object.
 double[][] getData(int[] variableIndices)
          Returns selected data held by this NumericData object.
 int getDataLength()
          Returns the length of the data.
 int getDimensionality()
          Returns the dimensionality of the data.
 java.lang.String[] getLabels()
          Returns the data 'labels' held by this NumericData object.
 java.lang.String[] getNames()
          Returns the variable names held by this NumericData object.
 double[][] normaliseData()
          Returns the data held by this object, normalised to the range [-1,1]
 double[][] normaliseData(double[][] newData)
          Normalises newData using the most recently used normalisation factors.
 double[][] normaliseData(double minVal, double maxVal)
          Returns the data held by this object, normalised to the range [minVal,maxVal]
 double[][] normaliseData(double minVal, double maxVal, int[] variableIndices)
          Returns the values of the data within the variables identified by variableIndices, normalised to the range [minVal,maxVal]
 double[][] normaliseData(int[] variableIndices)
          Returns the values of the data within the variables identified by variableIndices, normalised to the range [-1,1]
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericData

public NumericData(java.lang.String[] names,
                   double[][] data,
                   java.lang.String[] labels)
constructs a NumericData object with data, variable names and data labels.

Method Detail

getData

public double[][] getData()
Returns the data held by this NumericData object.


getData

public double[][] getData(int[] variableIndices)
Returns selected data held by this NumericData object.


getDataLength

public int getDataLength()
Returns the length of the data.


getDimensionality

public int getDimensionality()
Returns the dimensionality of the data.


getNames

public java.lang.String[] getNames()
Returns the variable names held by this NumericData object. If no names have been set this method will return null.


getLabels

public java.lang.String[] getLabels()
Returns the data 'labels' held by this NumericData object. If no labels have been set this method will return null.


normaliseData

public double[][] normaliseData()
Returns the data held by this object, normalised to the range [-1,1]


normaliseData

public double[][] normaliseData(double minVal,
                                double maxVal)
Returns the data held by this object, normalised to the range [minVal,maxVal]


normaliseData

public double[][] normaliseData(int[] variableIndices)
Returns the values of the data within the variables identified by variableIndices, normalised to the range [-1,1]


normaliseData

public double[][] normaliseData(double minVal,
                                double maxVal,
                                int[] variableIndices)
Returns the values of the data within the variables identified by variableIndices, normalised to the range [minVal,maxVal]


normaliseData

public double[][] normaliseData(double[][] newData)
Normalises newData using the most recently used normalisation factors. WARNING: this method will throw an Exception if normalisation has not been preformed previously, or if newData does not have the same dimensionality as the data used to create this object.


denormaliseData

public double[][] denormaliseData(double[][] normData)
This method uses the normalisation constants set as a side effect in normaliseData(). The input data is assumed to have the same dimensionality as the original data. If this is not the case, or if normaliseData has not been called previously, results are unpredictable and Exceptions may be thrown.


denormaliseData

public double[] denormaliseData(double[] normData,
                                int index)
This method uses the normalisation constants set as a side effect in normaliseData(). If an incorrect index is provided or if normaliseData has not been called previously results are unpredictable and Exceptions may be thrown.