|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.neural.data.buffer.codec.CSVDataCODEC
public class CSVDataCODEC
A CODEC used to read/write data from/to a CSV data file. There are two constructors provided, one is for reading, the other for writing. Make sure you use the correct one for your intended purpose. This CODEC is typically used with the BinaryDataLoader, to load external data into the Encog binary training format.
| Constructor Summary | |
|---|---|
CSVDataCODEC(File file,
CSVFormat format)
Constructor to create CSV from binary.. |
|
CSVDataCODEC(File file,
CSVFormat format,
boolean headers,
int inputCount,
int idealCount)
Create a CODEC to load data from CSV to binary. |
|
| Method Summary | |
|---|---|
void |
close()
Close any open files. |
int |
getIdealSize()
|
int |
getInputSize()
|
void |
prepareRead()
Prepare to read from the CSV file. |
void |
prepareWrite(int recordCount,
int inputSize,
int idealSize)
Prepare to write to a CSV file. |
boolean |
read(double[] input,
double[] ideal)
Read one record of data from a CSV file. |
void |
write(double[] input,
double[] ideal)
Write one record of data to a CSV file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CSVDataCODEC(File file,
CSVFormat format,
boolean headers,
int inputCount,
int idealCount)
file - The CSV file to load.format - The format that the CSV file is in.headers - True, if there are headers.inputCount - The number of input columns.idealCount - The number of ideal columns.
public CSVDataCODEC(File file,
CSVFormat format)
file - The CSV file to create.format - The format for that CSV file.| Method Detail |
|---|
public boolean read(double[] input,
double[] ideal)
read in interface DataSetCODECinput - The input data array.ideal - The ideal data array.
public void write(double[] input,
double[] ideal)
write in interface DataSetCODECinput - The input data array.ideal - The ideal data array.
public void prepareWrite(int recordCount,
int inputSize,
int idealSize)
prepareWrite in interface DataSetCODECrecordCount - The total record count, that will be written.inputSize - The input size.idealSize - The ideal size.public void prepareRead()
prepareRead in interface DataSetCODECpublic int getInputSize()
getInputSize in interface DataSetCODECpublic int getIdealSize()
getIdealSize in interface DataSetCODECpublic void close()
close in interface DataSetCODEC
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||