The Encog Project

org.encog.neural.data.basic
Class BasicNeuralDataSet

java.lang.Object
  extended by org.encog.neural.data.basic.BasicNeuralDataSet
All Implemented Interfaces:
java.lang.Iterable<NeuralDataPair>, NeuralDataSet, EncogPersistedObject
Direct Known Subclasses:
ImageNeuralDataSet, TemporalNeuralDataSet, XMLNeuralDataSet

public class BasicNeuralDataSet
extends java.lang.Object
implements NeuralDataSet, EncogPersistedObject

Basic implementation of the NeuralDataSet class. This class simply stores the neural data 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

Nested Class Summary
 class BasicNeuralDataSet.BasicNeuralIterator
          An iterator to be used with the BasicNeuralDataSet.
 
Constructor Summary
BasicNeuralDataSet()
          Default constructor.
BasicNeuralDataSet(double[][] input, double[][] ideal)
          Construct a data set from an input and idea array.
 
Method Summary
 void add(NeuralData data)
          Add input to the training set with no expected output.
 void add(NeuralData inputData, NeuralData idealData)
          Add input and expected output.
 void add(NeuralDataPair inputData)
          Add a neural data pair to the list.
 void close()
          Close this data set.
 java.util.List<NeuralDataPair> 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.
 java.util.Iterator<NeuralDataPair> iterator()
          Create an iterator for this collection.
 void setData(java.util.List<NeuralDataPair> data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicNeuralDataSet

public BasicNeuralDataSet()
Default constructor.


BasicNeuralDataSet

public BasicNeuralDataSet(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.
Method Detail

add

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

Specified by:
add in interface NeuralDataSet
Parameters:
data - The input to be added to the training set.

add

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

Specified by:
add in interface NeuralDataSet
Parameters:
inputData - The input data to train on.
idealData - The ideal data to use for training.

add

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

Specified by:
add in interface NeuralDataSet
Parameters:
inputData - A NeuralDataPair object that contains both input and ideal data.

close

public void close()
Close this data set.

Specified by:
close in interface NeuralDataSet

getData

public java.util.List<NeuralDataPair> 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 NeuralDataSet
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 NeuralDataSet
Returns:
The size of the input data.

iterator

public java.util.Iterator<NeuralDataPair> iterator()
Create an iterator for this collection.

Specified by:
iterator in interface java.lang.Iterable<NeuralDataPair>
Returns:
An iterator to access this collection.

setData

public void setData(java.util.List<NeuralDataPair> data)
Parameters:
data - the data to set

The Encog Project