org.neuroph.core.learning
Class DataSet

java.lang.Object
  extended by org.neuroph.core.learning.DataSet
All Implemented Interfaces:
Serializable

public class DataSet
extends Object
implements Serializable

A set of training elements for training neural network.

Author:
Zoran Sevarac extends AbstractCollection or Implements Collection http://openforecast.sourceforge.net/docs/net/sourceforge/openforecast/DataSet.html
See Also:
Serialized Form

Constructor Summary
DataSet(int inputSize)
          Creates an instance of new empty training set
DataSet(int inputVectorSize, int outputVectorSize)
          Creates an instance of new empty training set
 
Method Summary
 void addRow(DataSetRow row)
          Adds new row element to this data set
 void addRow(double[] input)
           
 void addRow(double[] input, double[] output)
           
 void clear()
          Removes all alements from training set
static DataSet createFromFile(String filePath, int inputsCount, int outputsCount, String delimiter)
           
 DataSet[] createTrainingAndTestSubsets(int trainSetPercent, int testSetPercent)
          Returns output vector size of training elements in this training set This method is implementation of EngineIndexableSet interface, and it is added to provide compatibility with Encog data sets and FlatNetwork
 String[] getColumnNames()
           
 String getFilePath()
          Returns full file path for this training set
 int getInputSize()
          Returns input vector size of training elements in this training set This method is implementation of EngineIndexableSet interface, and it is added to provide compatibility with Encog data sets and FlatNetwork
 String getLabel()
          Returns label for this training set
 int getOutputSize()
          Returns output vector size of training elements in this training set.
 DataSetRow getRowAt(int idx)
          Returns training element at specified index position
 List<DataSetRow> getRows()
          Returns elements of this training set
 boolean isEmpty()
          Returns true if training set is empty, false otherwise
 Iterator iterator()
          Returns Iterator for iterating training elements collection
static DataSet load(String filePath)
          Loads training set from the specified file
 void normalize()
           
 void normalize(Normalizer normalizer)
           
 void removeRowAt(int idx)
          Removes training element at specified index position
 void save()
          Saves this training set to file specified in its filePath field
 void save(String filePath)
          Saves this training set to the specified file
 void saveAsTxt(String filePath, String delimiter)
           
 void setColumnNames(String[] columnNames)
           
 void setFilePath(String filePath)
          Sets full file path for this training set
 void setLabel(String label)
          Sets label for this training set
 void shuffle()
           
 int size()
          Returns number of training elements in this training set set
 String toString()
          Returns label of this training set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataSet

public DataSet(int inputSize)
Creates an instance of new empty training set

Parameters:
inputVectorSize -

DataSet

public DataSet(int inputVectorSize,
               int outputVectorSize)
Creates an instance of new empty training set

Parameters:
inputVectorSize -
outputVectorSize -
Method Detail

addRow

public void addRow(DataSetRow row)
            throws VectorSizeMismatchException
Adds new row element to this data set

Parameters:
row - data set row to add
Throws:
VectorSizeMismatchException

addRow

public void addRow(double[] input)

addRow

public void addRow(double[] input,
                   double[] output)

removeRowAt

public void removeRowAt(int idx)
Removes training element at specified index position

Parameters:
idx - position of element to remove

iterator

public Iterator iterator()
Returns Iterator for iterating training elements collection

Returns:
Iterator for iterating training elements collection

getRows

public List<DataSetRow> getRows()
Returns elements of this training set

Returns:
training elements

getRowAt

public DataSetRow getRowAt(int idx)
Returns training element at specified index position

Parameters:
idx - index position of training element to return
Returns:
training element at specified index position

clear

public void clear()
Removes all alements from training set


isEmpty

public boolean isEmpty()
Returns true if training set is empty, false otherwise

Returns:
true if training set is empty, false otherwise

size

public int size()
Returns number of training elements in this training set set

Returns:
number of training elements in this training set set

getLabel

public String getLabel()
Returns label for this training set

Returns:
label for this training set

setLabel

public void setLabel(String label)
Sets label for this training set

Parameters:
label - label for this training set

getColumnNames

public String[] getColumnNames()

setColumnNames

public void setColumnNames(String[] columnNames)

setFilePath

public void setFilePath(String filePath)
Sets full file path for this training set

Parameters:
filePath -

getFilePath

public String getFilePath()
Returns full file path for this training set

Returns:
full file path for this training set

toString

public String toString()
Returns label of this training set

Overrides:
toString in class Object
Returns:
label of this training set

save

public void save(String filePath)
Saves this training set to the specified file

Parameters:
filePath -

save

public void save()
Saves this training set to file specified in its filePath field


saveAsTxt

public void saveAsTxt(String filePath,
                      String delimiter)

load

public static DataSet load(String filePath)
Loads training set from the specified file

Parameters:
filePath - training set file
Returns:
loded training set

createFromFile

public static DataSet createFromFile(String filePath,
                                     int inputsCount,
                                     int outputsCount,
                                     String delimiter)

normalize

public void normalize()

normalize

public void normalize(Normalizer normalizer)

createTrainingAndTestSubsets

public DataSet[] createTrainingAndTestSubsets(int trainSetPercent,
                                              int testSetPercent)
Returns output vector size of training elements in this training set This method is implementation of EngineIndexableSet interface, and it is added to provide compatibility with Encog data sets and FlatNetwork


getOutputSize

public int getOutputSize()
Returns output vector size of training elements in this training set.


getInputSize

public int getInputSize()
Returns input vector size of training elements in this training set This method is implementation of EngineIndexableSet interface, and it is added to provide compatibility with Encog data sets and FlatNetwork


shuffle

public void shuffle()


Copyright © 2012. All Rights Reserved.