org.encog.engine.data
Class BasicEngineDataSet

java.lang.Object
  extended by org.encog.engine.data.BasicEngineDataSet
All Implemented Interfaces:
Serializable, EngineDataSet, EngineIndexableSet

public class BasicEngineDataSet
extends Object
implements Serializable, EngineIndexableSet

Data is stored in an ArrayList. This class is memory based, so large enough datasets could cause memory issues. Many other dataset types extend this class.

Author:
jheaton
See Also:
Serialized Form

Constructor Summary
BasicEngineDataSet()
          Default constructor.
BasicEngineDataSet(double[][] input, double[][] ideal)
          Construct a data set from an input and idea array.
BasicEngineDataSet(List<EngineData> data)
          Construct a data set from an already created list.
 
Method Summary
 void add(double[] data)
          Add input to the training set with no expected output.
 void add(double[] inputData, double[] idealData)
          Add input and expected output.
 void add(EngineData inputData)
          Add a neural data pair to the list.
 List<EngineData> getData()
          Get the data held by this container.
 int getIdealSize()
          Get the size of the ideal dataset.
 int getInputSize()
          Get the size of the input dataset.
 void getRecord(long index, EngineData pair)
          Get a record by index into the specified pair.
 long getRecordCount()
          Determine the total number of records in the set.
 boolean isSupervised()
          Determine if this neural data set is supervied.
 EngineIndexableSet openAdditional()
          Create an additional data set.
 void setData(List<EngineData> data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicEngineDataSet

public BasicEngineDataSet()
Default constructor.


BasicEngineDataSet

public BasicEngineDataSet(double[][] input,
                          double[][] ideal)
Construct a data set from an input and idea array.

Parameters:
input - The input into the neural network for training.
ideal - The ideal output for training.

BasicEngineDataSet

public BasicEngineDataSet(List<EngineData> data)
Construct a data set from an already created list. Mostly used to duplicate this class.

Parameters:
data - The data to use.
Method Detail

add

public void add(double[] data)
Add input to the training set with no expected output. This is used for unsupervised training.

Parameters:
data - The input to be added to the training set.

add

public void add(double[] inputData,
                double[] idealData)
Add input and expected output. This is used for supervised training.

Parameters:
inputData - The input data to train on.
idealData - The ideal data to use for training.

add

public void add(EngineData inputData)
Add a neural data pair to the list.

Parameters:
inputData - A NeuralDataPair object that contains both input and ideal data.

getData

public List<EngineData> getData()
Get the data held by this container.

Returns:
the data

getIdealSize

public int getIdealSize()
Get the size of the ideal dataset. This is obtained from the first item in the list.

Specified by:
getIdealSize in interface EngineDataSet
Returns:
The size of the ideal data.

getInputSize

public int getInputSize()
Get the size of the input dataset. This is obtained from the first item in the list.

Specified by:
getInputSize in interface EngineDataSet
Returns:
The size of the input data.

getRecord

public void getRecord(long index,
                      EngineData pair)
Get a record by index into the specified pair.

Specified by:
getRecord in interface EngineIndexableSet
Parameters:
index - The index to read.
pair - The pair to hold the data.

getRecordCount

public long getRecordCount()
Description copied from interface: EngineIndexableSet
Determine the total number of records in the set.

Specified by:
getRecordCount in interface EngineIndexableSet
Returns:
The total number of records in the file.

isSupervised

public boolean isSupervised()
Determine if this neural data set is supervied. All of the pairs should be either supervised or not, so simply check the first pair. If the list is empty then assume unsupervised.

Specified by:
isSupervised in interface EngineDataSet
Returns:
True if supervised.

openAdditional

public EngineIndexableSet openAdditional()
Create an additional data set. It will use the same list.

Specified by:
openAdditional in interface EngineIndexableSet
Returns:
The additional data set.

setData

public void setData(List<EngineData> data)
Parameters:
data - the data to set


Copyright © 2011. All Rights Reserved.