org.encog.ml.data.versatile.sources
Class CSVDataSource
- java.lang.Object
-
- org.encog.ml.data.versatile.sources.CSVDataSource
-
- All Implemented Interfaces:
- VersatileDataSource
public class CSVDataSource extends java.lang.Object implements VersatileDataSource
Allow a CSV file to serve as a source for the versatile data source.
-
-
Constructor Summary
Constructors Constructor and Description CSVDataSource(java.io.File file, boolean headers, char delim)Construct a CSV source from a filename.CSVDataSource(java.io.File file, boolean headers, CSVFormat format)Construct a CSV source from a filename.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intcolumnIndex(java.lang.String name)Obtain the column index for the specified name.java.lang.String[]readLine()Read a line from the source.voidrewind()Rewind the source back to the beginning.
-
-
-
Constructor Detail
-
CSVDataSource
public CSVDataSource(java.io.File file, boolean headers, char delim)Construct a CSV source from a filename. The format parameter specifies the separator character to use, as well as the number format.- Parameters:
file- The file.headers- The headers.delim- The delimiter.
-
CSVDataSource
public CSVDataSource(java.io.File file, boolean headers, CSVFormat format)Construct a CSV source from a filename. Allows a delimiter character to be specified.- Parameters:
file- The file.headers- The headers.format- The format.
-
-
Method Detail
-
readLine
public java.lang.String[] readLine()
Read a line from the source.- Specified by:
readLinein interfaceVersatileDataSource- Returns:
- The values read.
-
rewind
public void rewind()
Rewind the source back to the beginning.- Specified by:
rewindin interfaceVersatileDataSource
-
columnIndex
public int columnIndex(java.lang.String name)
Obtain the column index for the specified name.- Specified by:
columnIndexin interfaceVersatileDataSource- Parameters:
name- The column name.- Returns:
- The column index, or -1 if not found.
-
-
DMelt 3.0 © DataMelt by jWork.ORG