The Encog Project

org.encog.neural.data.sql
Class SQLNeuralDataSet

java.lang.Object
  extended by org.encog.neural.data.sql.SQLNeuralDataSet
All Implemented Interfaces:
java.lang.Iterable<NeuralDataPair>, NeuralDataSet

public class SQLNeuralDataSet
extends java.lang.Object
implements NeuralDataSet

A dataset based on a SQL query. This is not a memory based dataset, so it can handle very large datasets without a memory issue. and can handle very large datasets.

Author:
jheaton

Nested Class Summary
 class SQLNeuralDataSet.SQLNeuralIterator
          Iterator used to iterate over SQL results.
 
Field Summary
static java.lang.String ADD_NOT_SUPPORTED
          Error message: adds are not supported.
static java.lang.String REMOVE_NOT_SUPPORTED
          Error message: removes are not supported.
 
Constructor Summary
SQLNeuralDataSet(java.lang.String sql, int inputSize, int idealSize, java.lang.String driver, java.lang.String url, java.lang.String uid, java.lang.String pwd)
          Construct a SQL dataset.
 
Method Summary
 void add(NeuralData data1)
          Adds are not supported.
 void add(NeuralData inputData, NeuralData idealData)
          Adds are not supported.
 void add(NeuralDataPair inputData)
          Adds are not supported.
 void close()
          Close the SQL connection.
 int getIdealSize()
           
 int getInputSize()
           
 java.util.Iterator<NeuralDataPair> iterator()
          Get an iterator for this collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADD_NOT_SUPPORTED

public static final java.lang.String ADD_NOT_SUPPORTED
Error message: adds are not supported.

See Also:
Constant Field Values

REMOVE_NOT_SUPPORTED

public static final java.lang.String REMOVE_NOT_SUPPORTED
Error message: removes are not supported.

See Also:
Constant Field Values
Constructor Detail

SQLNeuralDataSet

public SQLNeuralDataSet(java.lang.String sql,
                        int inputSize,
                        int idealSize,
                        java.lang.String driver,
                        java.lang.String url,
                        java.lang.String uid,
                        java.lang.String pwd)
Construct a SQL dataset.

Parameters:
sql - The SQL command to execute.
inputSize - The size of the input data.
idealSize - The size of the ideal data.
driver - The driver to use.
url - The database connection URL.
uid - The database user id.
pwd - The database password.
Method Detail

add

public void add(NeuralData data1)
Adds are not supported.

Specified by:
add in interface NeuralDataSet
Parameters:
data1 - Not used.

add

public void add(NeuralData inputData,
                NeuralData idealData)
Adds are not supported.

Specified by:
add in interface NeuralDataSet
Parameters:
inputData - Not used.
idealData - Not used.

add

public void add(NeuralDataPair inputData)
Adds are not supported.

Specified by:
add in interface NeuralDataSet
Parameters:
inputData - Not used.

close

public void close()
Close the SQL connection.

Specified by:
close in interface NeuralDataSet

getIdealSize

public int getIdealSize()
Specified by:
getIdealSize in interface NeuralDataSet
Returns:
The size of the ideal data.

getInputSize

public int getInputSize()
Specified by:
getInputSize in interface NeuralDataSet
Returns:
The size of the input data.

iterator

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

Specified by:
iterator in interface java.lang.Iterable<NeuralDataPair>
Returns:
An iterator for use with this collection.

The Encog Project