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 |
conf, inputSplit, lineIndex, locations, splitIndexlistenersAPPEND_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, loadFromMetaDatabatchesSupported, getListeners, invokeListeners, next, setListeners, setListenerspublic 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 RecordReaderinitialize in class LineRecordReaderconf - DataVec configurationsplit - FileSplitIOExceptionInterruptedExceptionpublic void setConf(Configuration conf)
setConf in interface ConfigurablesetConf in class LineRecordReaderconf - DataVec configurationIOExceptionInterruptedExceptionprotected Writable getNextRecord()
public boolean hasNext()
RecordReaderhasNext in interface RecordReaderhasNext in class LineRecordReaderpublic List<Writable> next()
next in interface RecordReadernext in class LineRecordReaderpublic Record nextRecord()
nextRecord in interface RecordReadernextRecord in class LineRecordReaderpublic List<Writable> record(URI uri, DataInputStream dataInputStream) throws IOException
RecordReaderRecordReader.next() the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStreamrecord in interface RecordReaderrecord in class LineRecordReaderIOException - if error occurs during reading from the input streampublic void reset()
RecordReaderreset in interface RecordReaderreset in class LineRecordReaderprotected void onLocationOpen(URI location)
onLocationOpen in class LineRecordReaderCopyright © 2017. All rights reserved.