org.encog.ml.data.buffer.codec
public class CSVDataCODEC extends Object implements DataSetCODEC
Constructor and Description |
---|
CSVDataCODEC(File theFile,
CSVFormat theFormat,
boolean theExpectSignificance)
Constructor to create CSV from binary..
|
CSVDataCODEC(File theFile,
CSVFormat theFormat,
boolean theHeaders,
int theInputCount,
int theIdealCount,
boolean theExpectSignificance)
Create a CODEC to load data from CSV to binary.
|
Modifier and Type | Method and Description |
---|---|
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,
double[] significance)
Read one record of data from a CSV file.
|
void |
write(double[] input,
double[] ideal,
double significance)
Write one record of data to a CSV file.
|
public CSVDataCODEC(File theFile, CSVFormat theFormat, boolean theExpectSignificance)
theFile
- The CSV file to create.theFormat
- The format for that CSV file.theExpectSignificance
- True, if a significance column is expected.public CSVDataCODEC(File theFile, CSVFormat theFormat, boolean theHeaders, int theInputCount, int theIdealCount, boolean theExpectSignificance)
theFile
- The CSV file to load.theFormat
- The format that the CSV file is in.theHeaders
- True, if there are headers.theInputCount
- The number of input columns.theIdealCount
- The number of ideal columns.theExpectSignificance
- True, if a significance column is expected.public void close()
close
in interface DataSetCODEC
public int getIdealSize()
getIdealSize
in interface DataSetCODEC
public int getInputSize()
getInputSize
in interface DataSetCODEC
public void prepareRead()
prepareRead
in interface DataSetCODEC
public void prepareWrite(int recordCount, int inputSize, int idealSize)
prepareWrite
in interface DataSetCODEC
recordCount
- The total record count, that will be written.inputSize
- The input size.idealSize
- The ideal size.public boolean read(double[] input, double[] ideal, double[] significance)
read
in interface DataSetCODEC
input
- The input data array.ideal
- The ideal data array.significance
- The significance. The first element will be modified
to hold the significance.public void write(double[] input, double[] ideal, double significance)
write
in interface DataSetCODEC
input
- The input data array.ideal
- The ideal data array.Copyright © 2014. All Rights Reserved.