public class DataVecSequenceDataSetFunction
extends java.lang.Object
implements org.apache.spark.api.java.function.Function<java.util.List<java.util.List<org.datavec.api.writable.Writable>>,org.nd4j.linalg.dataset.DataSet>, java.io.Serializable
Collection<Collection<Writable>>
objects (out of a datavec-spark sequence record reader function) to
DataSet objects for Spark training.
Analogous to SequenceRecordReaderDataSetIterator
, but in the context of Spark.
Supports loading data from a single source only (hence no masknig arrays, many-to-one etc here)
see DataVecSequencePairDataSetFunction
for the separate collections for input and labels versionConstructor and Description |
---|
DataVecSequenceDataSetFunction(int labelIndex,
int numPossibleLabels,
boolean regression) |
DataVecSequenceDataSetFunction(int labelIndex,
int numPossibleLabels,
boolean regression,
org.nd4j.linalg.dataset.api.DataSetPreProcessor preProcessor,
org.datavec.api.io.WritableConverter converter) |
Modifier and Type | Method and Description |
---|---|
org.nd4j.linalg.dataset.DataSet |
call(java.util.List<java.util.List<org.datavec.api.writable.Writable>> input) |
public DataVecSequenceDataSetFunction(int labelIndex, int numPossibleLabels, boolean regression)
labelIndex
- Index of the label columnnumPossibleLabels
- Number of classes for classification (not used if regression = true)regression
- False for classification, true for regressionpublic DataVecSequenceDataSetFunction(int labelIndex, int numPossibleLabels, boolean regression, org.nd4j.linalg.dataset.api.DataSetPreProcessor preProcessor, org.datavec.api.io.WritableConverter converter)
labelIndex
- Index of the label columnnumPossibleLabels
- Number of classes for classification (not used if regression = true)regression
- False for classification, true for regressionpreProcessor
- DataSetPreprocessor (may be null)converter
- WritableConverter (may be null)public org.nd4j.linalg.dataset.DataSet call(java.util.List<java.util.List<org.datavec.api.writable.Writable>> input) throws java.lang.Exception
call
in interface org.apache.spark.api.java.function.Function<java.util.List<java.util.List<org.datavec.api.writable.Writable>>,org.nd4j.linalg.dataset.DataSet>
java.lang.Exception