Class SVMLightRecordWriter
- java.lang.Object
-
- org.datavec.api.records.writer.impl.FileRecordWriter
-
- org.datavec.api.records.writer.impl.misc.SVMLightRecordWriter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Configurable
,RecordWriter
- Direct Known Subclasses:
LibSvmRecordWriter
public class SVMLightRecordWriter extends FileRecordWriter
-
-
Field Summary
Fields Modifier and Type Field Description static String
FEATURE_FIRST_COLUMN
static String
FEATURE_LAST_COLUMN
protected int
featureFirstColumn
protected int
featureLastColumn
static String
HAS_LABELS
protected boolean
hasLabel
static String
LABEL_FIRST_COLUMN
static String
LABEL_LAST_COLUMN
protected int
labelFirstColumn
protected int
labelLastColumn
protected boolean
multilabel
static String
MULTILABEL
static String
NAME_SPACE
static String
UNLABELED
static String
ZERO_BASED_INDEXING
static String
ZERO_BASED_LABEL_INDEXING
protected boolean
zeroBasedIndexing
protected boolean
zeroBasedLabelIndexing
-
Fields inherited from class org.datavec.api.records.writer.impl.FileRecordWriter
conf, DEFAULT_CHARSET, encoding, NEW_LINE, out, partitioner
-
Fields inherited from interface org.datavec.api.records.writer.RecordWriter
APPEND
-
-
Constructor Summary
Constructors Constructor Description SVMLightRecordWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setConf(Configuration conf)
Set DataVec configurationboolean
supportsBatch()
Returns true if this record writer supports efficient batch writing usingRecordWriter.writeBatch(List)
PartitionMetaData
write(List<Writable> record)
Write next record.PartitionMetaData
writeBatch(List<List<Writable>> batch)
Write a batch of records-
Methods inherited from class org.datavec.api.records.writer.impl.FileRecordWriter
close, getConf, initialize, initialize
-
-
-
-
Field Detail
-
NAME_SPACE
public static final String NAME_SPACE
-
FEATURE_FIRST_COLUMN
public static final String FEATURE_FIRST_COLUMN
-
FEATURE_LAST_COLUMN
public static final String FEATURE_LAST_COLUMN
-
ZERO_BASED_INDEXING
public static final String ZERO_BASED_INDEXING
-
ZERO_BASED_LABEL_INDEXING
public static final String ZERO_BASED_LABEL_INDEXING
-
HAS_LABELS
public static final String HAS_LABELS
-
MULTILABEL
public static final String MULTILABEL
-
LABEL_FIRST_COLUMN
public static final String LABEL_FIRST_COLUMN
-
LABEL_LAST_COLUMN
public static final String LABEL_LAST_COLUMN
-
UNLABELED
public static final String UNLABELED
- See Also:
- Constant Field Values
-
featureFirstColumn
protected int featureFirstColumn
-
featureLastColumn
protected int featureLastColumn
-
zeroBasedIndexing
protected boolean zeroBasedIndexing
-
zeroBasedLabelIndexing
protected boolean zeroBasedLabelIndexing
-
hasLabel
protected boolean hasLabel
-
multilabel
protected boolean multilabel
-
labelFirstColumn
protected int labelFirstColumn
-
labelLastColumn
protected int labelLastColumn
-
-
Method Detail
-
setConf
public void setConf(Configuration conf)
Set DataVec configuration- Specified by:
setConf
in interfaceConfigurable
- Overrides:
setConf
in classFileRecordWriter
- Parameters:
conf
-
-
supportsBatch
public boolean supportsBatch()
Description copied from interface:RecordWriter
Returns true if this record writer supports efficient batch writing usingRecordWriter.writeBatch(List)
- Returns:
-
write
public PartitionMetaData write(List<Writable> record) throws IOException
Write next record.- Parameters:
record
-- Throws:
IOException
-
writeBatch
public PartitionMetaData writeBatch(List<List<Writable>> batch) throws IOException
Description copied from interface:RecordWriter
Write a batch of records- Parameters:
batch
- the batch to write- Throws:
IOException
-
-