org.encog.neural.data.xml
Class XMLNeuralDataSet

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

public class XMLNeuralDataSet
extends Object
implements NeuralDataSet

A data source that reads XML files. This class is not memory based, so very large XML files can be used, without problem. The XML data is assumed to look something like below. The names of the tags can be configured using the various properties on this object. 00 0 10 1 01 1 11 0


Nested Class Summary
 class XMLNeuralDataSet.XMLNeuralIterator
          An iterator designed to read from XML files.
 
Field Summary
static String ADD_NOT_SUPPORTED
          Error Message: adds are not supported.
 
Constructor Summary
XMLNeuralDataSet(String filename, int inputSize, int idealSize, String pairXML, String inputXML, String idealXML, String valueXML)
          Construct an XML neural data set.
 
Method Summary
 void add(NeuralData data1)
          Adds are not supported, this is a read only data set.
 void add(NeuralData inputData, NeuralData idealData)
          Adds are not supported, this is a read only data set.
 void add(NeuralDataPair inputData)
          Adds are not supported, this is a read only data set.
 void close()
          Close the XML data source.
 String getFilename()
           
 int getIdealSize()
           
 String getIdealXML()
           
 int getInputSize()
           
 String getInputXML()
           
 String getPairXML()
           
 String getValueXML()
           
 boolean isSupervised()
           
 Iterator<NeuralDataPair> iterator()
           
 
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 String ADD_NOT_SUPPORTED
Error Message: adds are not supported.

See Also:
Constant Field Values
Constructor Detail

XMLNeuralDataSet

public XMLNeuralDataSet(String filename,
                        int inputSize,
                        int idealSize,
                        String pairXML,
                        String inputXML,
                        String idealXML,
                        String valueXML)
Construct an XML neural data set.

Parameters:
filename - The filename to read.
inputSize - The input size.
idealSize - The ideal size. Zero for unsupervised.
pairXML - The XML that starts a pair.
inputXML - The XML that starts input.
idealXML - The XML that starts ideal.
valueXML - The XML that starts values.
Method Detail

add

public void add(NeuralData data1)
Adds are not supported, this is a read only data set.

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

add

public void add(NeuralData inputData,
                NeuralData idealData)
Adds are not supported, this is a read only data set.

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

add

public void add(NeuralDataPair inputData)
Adds are not supported, this is a read only data set.

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

close

public void close()
Close the XML data source.

Specified by:
close in interface NeuralDataSet

getFilename

public String getFilename()
Returns:
The XML filename.

getIdealSize

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

getIdealXML

public String getIdealXML()
Returns:
The XML tag for ideal.

getInputSize

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

getInputXML

public String getInputXML()
Returns:
The XML tag for input.

getPairXML

public String getPairXML()
Returns:
The XML tag for pairs.

getValueXML

public String getValueXML()
Returns:
The XML tag for values.

iterator

public Iterator<NeuralDataPair> iterator()
Specified by:
iterator in interface Iterable<NeuralDataPair>
Returns:
An iterator for this data.

isSupervised

public boolean isSupervised()
Specified by:
isSupervised in interface EngineDataSet
Specified by:
isSupervised in interface NeuralDataSet
Returns:
True if this training data is supervised.


Copyright © 2011. All Rights Reserved.