public class CsvDatasetReader extends DatasetReader
Modifier and Type | Class and Description |
---|---|
static class |
CsvDatasetReader.LabelPosition |
inputBuffer, nextRow
Constructor and Description |
---|
CsvDatasetReader(String filename,
String representationName,
boolean skipFirstLine,
CsvDatasetReader.LabelPosition labelPosition)
Constructor for reading dataset in csv format.
|
CsvDatasetReader(String filename,
String representationName,
boolean skipFirstLine,
CsvDatasetReader.LabelPosition labelPosition,
StringLabel regressionPropertyName)
Constructor for reading dataset in csv format for regression tasks (the regression value is assumed to
be in the first column).
|
Modifier and Type | Method and Description |
---|---|
Example |
readNextExample()
Returns the next example
|
checkRowValidity, close, hasNext, openBufferedReader, restartReading, skipExample
public CsvDatasetReader(String filename, String representationName, boolean skipFirstLine, CsvDatasetReader.LabelPosition labelPosition) throws IOException
filename
- the path of the file to be readrepresentationName
- the name of the vector representation each example consists ofskipFirstLine
- if true the first line is skipped (to be used when it contains the header)labelInFirstColumn
- if true the first column is assumed to be a classification label,
if false the examples are without label (probably for clustering tasks)IOException
public CsvDatasetReader(String filename, String representationName, boolean skipFirstLine, CsvDatasetReader.LabelPosition labelPosition, StringLabel regressionPropertyName) throws IOException
filename
- the path of the file to be readrepresentationName
- the name of the vector representation each example consists ofskipFirstLine
- if true the first line is skipped (to be used when it contains the header)regressionPropertyName
- the name of the regression property to be learned (it is assumed that the first
column contains the regression value)IOException
public Example readNextExample() throws IOException, InstantiationException
DatasetReader
readNextExample
in class DatasetReader
IOException
InstantiationException
Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.