org.encog.ml.data.buffer.codec
Class ArrayDataCODEC
- java.lang.Object
-
- org.encog.ml.data.buffer.codec.ArrayDataCODEC
-
- All Implemented Interfaces:
- DataSetCODEC
public class ArrayDataCODEC extends java.lang.Object implements DataSetCODEC
A CODEC used for arrays.
-
-
Constructor Summary
Constructors Constructor and Description ArrayDataCODEC()Default constructor.ArrayDataCODEC(double[][] theInput, double[][] theIdeal)Construct an array CODEC.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclose()Close any open files.double[][]getIdeal()intgetIdealSize()double[][]getInput()intgetInputSize()voidprepareRead()Prepare to read from an external data source.voidprepareWrite(int recordCount, int theInputSize, int theIdealSize)Prepare to write to an external data destination.booleanread(double[] theInput, double[] theIdeal, double[] significance)Read one record of data from an external source.voidwrite(double[] theInput, double[] theIdeal, double significance)Write one record of data to an external destination.
-
-
-
Constructor Detail
-
ArrayDataCODEC
public ArrayDataCODEC(double[][] theInput, double[][] theIdeal)Construct an array CODEC.- Parameters:
theInput- The input array.theIdeal- The ideal array.
-
ArrayDataCODEC
public ArrayDataCODEC()
Default constructor.
-
-
Method Detail
-
getInputSize
public int getInputSize()
- Specified by:
getInputSizein interfaceDataSetCODEC- Returns:
- The size of the input data.
-
getIdealSize
public int getIdealSize()
- Specified by:
getIdealSizein interfaceDataSetCODEC- Returns:
- The size of the ideal data.
-
read
public boolean read(double[] theInput, double[] theIdeal, double[] significance)Read one record of data from an external source.- Specified by:
readin interfaceDataSetCODEC- Parameters:
theInput- The input data array.theIdeal- The ideal data array.significance- The significance. The first element will be modified to hold the significance.- Returns:
- True, if there is more data to be read.
-
write
public void write(double[] theInput, double[] theIdeal, double significance)Write one record of data to an external destination.- Specified by:
writein interfaceDataSetCODEC- Parameters:
theInput- The input data array.theIdeal- The ideal data array.significance- The significance (full = 1.0)
-
prepareWrite
public void prepareWrite(int recordCount, int theInputSize, int theIdealSize)Prepare to write to an external data destination.- Specified by:
prepareWritein interfaceDataSetCODEC- Parameters:
recordCount- The total record count, that will be written.theInputSize- The input size.theIdealSize- The ideal size.
-
getInput
public double[][] getInput()
- Returns:
- The input array.
-
getIdeal
public double[][] getIdeal()
- Returns:
- The ideal array.
-
prepareRead
public void prepareRead()
Prepare to read from an external data source.- Specified by:
prepareReadin interfaceDataSetCODEC
-
close
public void close()
Close any open files.- Specified by:
closein interfaceDataSetCODEC
-
-
DMelt 3.0 © DataMelt by jWork.ORG