Package ai.djl.basicdataset.tabular
Class TabularDataset
java.lang.Object
ai.djl.training.dataset.RandomAccessDataset
ai.djl.basicdataset.tabular.TabularDataset
- All Implemented Interfaces:
ai.djl.training.dataset.Dataset
- Direct Known Subclasses:
CsvDataset
public abstract class TabularDataset
extends ai.djl.training.dataset.RandomAccessDataset
A abstract class for creating tabular datasets.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ai.djl.training.dataset.Dataset
ai.djl.training.dataset.Dataset.Usage
-
Field Summary
Fields inherited from class ai.djl.training.dataset.RandomAccessDataset
dataBatchifier, device, labelBatchifier, limit, pipeline, prefetchNumber, sampler, targetPipeline
-
Constructor Summary
ConstructorDescriptionTabularDataset
(TabularDataset.BaseBuilder<?> builder) Creates a new instance ofRandomAccessDataset
with the given necessary configurations. -
Method Summary
Modifier and TypeMethodDescriptionai.djl.training.dataset.Record
get
(ai.djl.ndarray.NDManager manager, long index) abstract String
Returns a cell in the dataset.Returns the dataset features.int
Gets the feature size of currentTabularDataset
.Returns the dataset labels.int
Gets the label size of currentTabularDataset
.getRowDirect
(long index, List<Feature> selected) Returns the direct designated features (either data or label features) from a row.ai.djl.ndarray.NDList
getRowFeatures
(ai.djl.ndarray.NDManager manager, long index, List<Feature> selected) Returns the designated features (either data or label features) from a row.ai.djl.translate.TranslatorOptions
protected void
Prepares thePreparedFeaturizer
s.Methods inherited from class ai.djl.training.dataset.RandomAccessDataset
availableSize, getData, getData, getData, getData, newSubDataset, newSubDataset, randomSplit, size, subDataset, subDataset, subDataset, subDataset, toArray
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ai.djl.training.dataset.Dataset
prepare, prepare
-
Field Details
-
features
-
labels
-
-
Constructor Details
-
TabularDataset
Creates a new instance ofRandomAccessDataset
with the given necessary configurations.- Parameters:
builder
- a builder with the necessary configurations
-
-
Method Details
-
getFeatureSize
public int getFeatureSize()Gets the feature size of currentTabularDataset
.- Returns:
- the feature size
-
getLabelSize
public int getLabelSize()Gets the label size of currentTabularDataset
.- Returns:
- the feature size
-
getFeatures
Returns the dataset features.- Returns:
- the dataset features
-
getLabels
Returns the dataset labels.- Returns:
- the dataset labels
-
get
public ai.djl.training.dataset.Record get(ai.djl.ndarray.NDManager manager, long index) - Specified by:
get
in classai.djl.training.dataset.RandomAccessDataset
-
getRowDirect
Returns the direct designated features (either data or label features) from a row.- Parameters:
index
- the index of the requested data itemselected
- the features to pull from the row- Returns:
- the direct features
-
getRowFeatures
public ai.djl.ndarray.NDList getRowFeatures(ai.djl.ndarray.NDManager manager, long index, List<Feature> selected) Returns the designated features (either data or label features) from a row.- Parameters:
manager
- the manager used to create the arraysindex
- the index of the requested data itemselected
- the features to pull from the row- Returns:
- the features formatted as an
NDList
-
prepareFeaturizers
protected void prepareFeaturizers()Prepares thePreparedFeaturizer
s. -
getCell
Returns a cell in the dataset.- Parameters:
rowIndex
- the row index or record index for the cellfeatureName
- the feature or column of the cell- Returns:
- the value of the cell at that row and column
-
matchingTranslatorOptions
public ai.djl.translate.TranslatorOptions matchingTranslatorOptions()
-