public interface DataSet extends Iterable<DataSet>, Serializable
Modifier and Type | Method and Description |
---|---|
void |
addFeatureVector(INDArray toAdd) |
void |
addFeatureVector(INDArray feature,
int example) |
void |
addRow(DataSet d,
int i) |
void |
apply(Condition condition,
com.google.common.base.Function<Number,Number> function) |
List<DataSet> |
asList()
Extract each example in the DataSet into its own DataSet object, and return all of them as a list
|
List<DataSet> |
batchBy(int num) |
List<DataSet> |
batchByNumLabels() |
void |
binarize() |
void |
binarize(double cutoff) |
DataSet |
copy()
Create a copy of the DataSet
|
List<DataSet> |
dataSetBatches(int num)
Deprecated.
prefer
batchBy(int) |
void |
detach()
This method detaches this DataSet from current Workspace (if any)
|
void |
divideBy(int num)
Divide the features by a scalar
|
INDArray |
exampleMaxs() |
INDArray |
exampleMeans() |
INDArray |
exampleSums() |
void |
filterAndStrip(int[] labels) |
DataSet |
filterBy(int[] labels) |
DataSet |
get(int i) |
DataSet |
get(int[] i) |
List<String> |
getColumnNames() |
List<Serializable> |
getExampleMetaData()
Get the example metadata, or null if no metadata has been set
|
<T extends Serializable> |
getExampleMetaData(Class<T> metaDataType)
Get the example metadata, or null if no metadata has been set
Note: this method results in an unchecked cast - care should be taken when using this! |
INDArray |
getFeatureMatrix()
Deprecated.
Use
getFeatures() |
INDArray |
getFeatures()
Returns the features array for the DataSet
|
INDArray |
getFeaturesMaskArray()
Input mask array: a mask array for input, where each value is in {0,1} in order to specify whether an input is
actually present or not.
|
String |
getLabelName(int idx) |
List<String> |
getLabelNames()
Deprecated.
|
List<String> |
getLabelNames(INDArray idxs) |
List<String> |
getLabelNamesList() |
INDArray |
getLabels() |
INDArray |
getLabelsMaskArray()
Labels (output) mask array: a mask array for input, where each value is in {0,1} in order to specify whether an
output is actually present or not.
|
long |
getMemoryFootprint()
This method returns memory used by this DataSet
|
DataSet |
getRange(int from,
int to) |
boolean |
hasMaskArrays()
Whether the labels or input (features) mask arrays are present for this DataSet
|
String |
id() |
DataSetIterator |
iterateWithMiniBatches()
Deprecated.
|
Iterator<DataSet> |
iterator() |
Map<Integer,Double> |
labelCounts()
Calculate and return a count of each label, by index.
|
void |
load(File from)
Load the contents of the DataSet from the specified File.
|
void |
load(InputStream from)
Load the contents of the DataSet from the specified InputStream.
|
void |
migrate()
This method migrates this DataSet into current Workspace (if any)
|
void |
multiplyBy(double num)
Multiply the features by a scalar
|
void |
normalize()
Normalize this DataSet to mean 0, stdev 1 per input.
|
void |
normalizeZeroMeanZeroUnitVariance()
Deprecated.
|
int |
numExamples()
Number of examples in the DataSet
|
int |
numInputs()
Number of input values - i.e., size of the features INDArray per example
|
int |
numOutcomes()
Returns the number of outcomes (size of the labels array for each example)
|
int |
outcome() |
DataSet |
reshape(int rows,
int cols) |
void |
roundToTheNearest(int roundTo) |
DataSet |
sample(int numSamples) |
DataSet |
sample(int numSamples,
boolean withReplacement) |
DataSet |
sample(int numSamples,
Random rng) |
DataSet |
sample(int numSamples,
Random rng,
boolean withReplacement) |
void |
save(File to)
Save this DataSet to a file.
|
void |
save(OutputStream to)
Write the contents of this DataSet to the specified OutputStream
|
void |
scale() |
void |
scaleMinAndMax(double min,
double max) |
void |
setColumnNames(List<String> columnNames) |
void |
setExampleMetaData(List<? extends Serializable> exampleMetaData)
Set the metadata for this DataSet
By convention: the metadata can be any serializable object, one per example in the DataSet |
void |
setFeatures(INDArray features)
Set the features array for the DataSet
|
void |
setFeaturesMaskArray(INDArray inputMask)
Set the features mask array in this DataSet
|
void |
setLabelNames(List<String> labelNames) |
void |
setLabels(INDArray labels) |
void |
setLabelsMaskArray(INDArray labelsMask)
Set the labels mask array in this data set
|
void |
setNewNumberOfLabels(int labels) |
void |
setOutcome(int example,
int label) |
void |
shuffle()
Shuffle the order of the rows in the DataSet.
|
List<DataSet> |
sortAndBatchByNumLabels() |
void |
sortByLabel() |
SplitTestAndTrain |
splitTestAndTrain(double percentTrain)
Split the DataSet into two DataSets randomly
|
SplitTestAndTrain |
splitTestAndTrain(int numHoldout) |
SplitTestAndTrain |
splitTestAndTrain(int numHoldout,
Random rnd) |
void |
squishToRange(double min,
double max) |
void |
validate() |
forEach, spliterator
DataSet getRange(int from, int to)
void load(InputStream from)
save(OutputStream)
from
- InputStream to load the DataSet fromvoid load(File from)
save(File)
from
- File to load the DataSet fromvoid save(OutputStream to)
to
- OutputStream to save the DataSet tovoid save(File to)
to
- File to sa@Deprecated DataSetIterator iterateWithMiniBatches()
String id()
INDArray getFeatures()
void setFeatures(INDArray features)
features
- Features to setMap<Integer,Double> labelCounts()
DataSet copy()
DataSet reshape(int rows, int cols)
void multiplyBy(double num)
void divideBy(int num)
void shuffle()
void squishToRange(double min, double max)
void scaleMinAndMax(double min, double max)
void scale()
void addFeatureVector(INDArray toAdd)
void addFeatureVector(INDArray feature, int example)
void normalize()
NormalizerStandardize
void binarize()
void binarize(double cutoff)
@Deprecated void normalizeZeroMeanZeroUnitVariance()
NormalizerStandardize
int numInputs()
void validate()
int outcome()
void setNewNumberOfLabels(int labels)
void setOutcome(int example, int label)
DataSet get(int i)
DataSet get(int[] i)
DataSet filterBy(int[] labels)
void filterAndStrip(int[] labels)
@Deprecated List<DataSet> dataSetBatches(int num)
batchBy(int)
List<DataSet> asList()
SplitTestAndTrain splitTestAndTrain(int numHoldout, Random rnd)
SplitTestAndTrain splitTestAndTrain(int numHoldout)
INDArray getLabels()
void setLabels(INDArray labels)
@Deprecated INDArray getFeatureMatrix()
getFeatures()
getFeatures()
void sortByLabel()
void addRow(DataSet d, int i)
INDArray exampleSums()
INDArray exampleMaxs()
INDArray exampleMeans()
DataSet sample(int numSamples)
DataSet sample(int numSamples, boolean withReplacement)
void roundToTheNearest(int roundTo)
int numOutcomes()
int numExamples()
@Deprecated List<String> getLabelNames()
String getLabelName(int idx)
SplitTestAndTrain splitTestAndTrain(double percentTrain)
percentTrain
- Percentage of examples to be returned in the training DataSet objectINDArray getFeaturesMaskArray()
void setFeaturesMaskArray(INDArray inputMask)
INDArray getLabelsMaskArray()
void setLabelsMaskArray(INDArray labelsMask)
boolean hasMaskArrays()
void setExampleMetaData(List<? extends Serializable> exampleMetaData)
exampleMetaData
- Example metadata to set<T extends Serializable> List<T> getExampleMetaData(Class<T> metaDataType)
T
- Type of metadatametaDataType
- Class of the metadata (used for type information)List<Serializable> getExampleMetaData()
#getExampleMetaData(Class)} for convenience method for types
long getMemoryFootprint()
void migrate()
void detach()
Copyright © 2017. All rights reserved.