mulan.classifier.neural
Class DataPair

java.lang.Object
  extended by mulan.classifier.neural.DataPair

public class DataPair
extends Object

Class for representation of a data-pair instance. The data pair contains an input pattern and respected true or expected output pattern for the input pattern.

Version:
2012.02.27
Author:
Jozef Vilcek

Constructor Summary
DataPair(double[] inputPattern, double[] trueOutput)
          Creates a DataPair instance.
 
Method Summary
static List<DataPair> createDataPairs(MultiLabelInstances mlDataSet, boolean bipolarOutput)
          Creates a DataPair representation for each Instance contained in MultiLabelInstances data set.
 double[] getInput()
          Gets the input pattern.
 double[] getOutput()
          Gets the ideal/expected output pattern.
 boolean[] getOutputBoolean()
          Gets the ideal/expected output pattern as boolean values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataPair

public DataPair(double[] inputPattern,
                double[] trueOutput)
Creates a DataPair instance.

Parameters:
inputPattern - the input pattern
trueOutput - the true/expected output pattern for the input
Method Detail

getInput

public double[] getInput()
Gets the input pattern.

Returns:
the input pattern

getOutput

public double[] getOutput()
Gets the ideal/expected output pattern.

Returns:
the output pattern

getOutputBoolean

public boolean[] getOutputBoolean()
Gets the ideal/expected output pattern as boolean values. This is useful when output represents labels bipartition. If output values in double[] are not in boolean representation, then output of this method is might not be valid. The computation is as follows:

- if value is equal to 1, then output is true in boolean

- if value is other than 1, then output is false in boolean

Returns:
the boolean representation of the output pattern

createDataPairs

public static List<DataPair> createDataPairs(MultiLabelInstances mlDataSet,
                                             boolean bipolarOutput)
Creates a DataPair representation for each Instance contained in MultiLabelInstances data set. The DataPair is a light weight representation of instance values (by double values), which is useful when iteration over the data and its values.

Parameters:
mlDataSet - the MultiLabelInstances which content has to be converted to list of DataPair
bipolarOutput - indicates whether output values should be converted to bipolar values, or left intact as binary
Returns:
the list of data pairs