public class SVMLightRecordReader extends LineRecordReader
Modifier and Type | Field and Description |
---|---|
static String |
ALLOWED_DELIMITERS |
protected boolean |
appendLabel |
static String |
COMMENT_CHAR |
static String |
FEATURE_DELIMITER |
static String |
LABEL_DELIMITER |
static Writable |
LABEL_ONE |
static Writable |
LABEL_ZERO |
protected boolean |
multilabel |
static String |
MULTILABEL |
static String |
NAME_SPACE |
static String |
NUM_ATTRIBUTES |
static String |
NUM_FEATURES |
static String |
NUM_LABELS |
protected int |
numFeatures |
protected int |
numLabels |
static Writable |
ONE |
static String |
PREFERRED_DELIMITER |
static String |
QID_PREFIX |
protected Writable |
recordLookahead |
static Writable |
ZERO |
static String |
ZERO_BASED_INDEXING |
static String |
ZERO_BASED_LABEL_INDEXING |
protected boolean |
zeroBasedIndexing |
protected boolean |
zeroBasedLabelIndexing |
charset, conf, initialized, lineIndex, locations, splitIndex
inputSplit, listeners, streamCreatorFn
APPEND_LABEL, LABELS
Constructor and Description |
---|
SVMLightRecordReader() |
Modifier and Type | Method and Description |
---|---|
protected Writable |
getNextRecord()
Helper function to help detect lines that are
commented out.
|
boolean |
hasNext()
Whether there are anymore records
|
void |
initialize(Configuration conf,
InputSplit split)
Must be called before attempting to read records.
|
List<Writable> |
next()
Return next record as list of Writables.
|
Record |
nextRecord()
Return next Record.
|
protected void |
onLocationOpen(URI location) |
List<Writable> |
record(URI uri,
DataInputStream dataInputStream)
Load the record from the given DataInputStream
Unlike
RecordReader.next() the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStream |
void |
reset()
Reset record reader iterator
|
void |
setConf(Configuration conf)
Set configuration.
|
close, closeIfRequired, getConf, getIterator, getLabels, initialize, loadFromMetaData, loadFromMetaData, resetSupported
batchesSupported, getListeners, invokeListeners, next, setListeners, setListeners
public static final String NAME_SPACE
public static final String NUM_FEATURES
public static final String ZERO_BASED_INDEXING
public static final String ZERO_BASED_LABEL_INDEXING
public static final String MULTILABEL
public static final String NUM_LABELS
public static final String COMMENT_CHAR
public static final String ALLOWED_DELIMITERS
public static final String PREFERRED_DELIMITER
public static final String FEATURE_DELIMITER
public static final String LABEL_DELIMITER
public static final String QID_PREFIX
public static final Writable ZERO
public static final Writable ONE
public static final Writable LABEL_ZERO
public static final Writable LABEL_ONE
protected int numFeatures
protected boolean zeroBasedIndexing
protected boolean zeroBasedLabelIndexing
protected boolean appendLabel
protected boolean multilabel
protected int numLabels
protected Writable recordLookahead
public static final String NUM_ATTRIBUTES
public void initialize(Configuration conf, InputSplit split) throws IOException, InterruptedException
initialize
in interface RecordReader
initialize
in class LineRecordReader
conf
- DataVec configurationsplit
- FileSplitIOException
InterruptedException
public void setConf(Configuration conf)
setConf
in interface Configurable
setConf
in class LineRecordReader
conf
- DataVec configurationIOException
InterruptedException
protected Writable getNextRecord()
public boolean hasNext()
RecordReader
hasNext
in interface RecordReader
hasNext
in class LineRecordReader
public List<Writable> next()
next
in interface RecordReader
next
in class LineRecordReader
public Record nextRecord()
nextRecord
in interface RecordReader
nextRecord
in class LineRecordReader
public List<Writable> record(URI uri, DataInputStream dataInputStream) throws IOException
RecordReader
RecordReader.next()
the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStreamrecord
in interface RecordReader
record
in class LineRecordReader
IOException
- if error occurs during reading from the input streampublic void reset()
RecordReader
reset
in interface RecordReader
reset
in class LineRecordReader
protected void onLocationOpen(URI location)
onLocationOpen
in class LineRecordReader
Copyright © 2020. All rights reserved.