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 ClassesNested classes/interfaces inherited from interface ai.djl.training.dataset.Dataset
ai.djl.training.dataset.Dataset.Usage -
Field Summary
FieldsFields inherited from class ai.djl.training.dataset.RandomAccessDataset
dataBatchifier, device, labelBatchifier, limit, pipeline, prefetchNumber, sampler, targetPipeline -
Constructor Summary
ConstructorsConstructorDescriptionTabularDataset(TabularDataset.BaseBuilder<?> builder) Creates a new instance ofRandomAccessDatasetwith the given necessary configurations. -
Method Summary
Modifier and TypeMethodDescriptionai.djl.training.dataset.Recordget(ai.djl.ndarray.NDManager manager, long index) abstract StringReturns a cell in the dataset.Returns the dataset features.intGets the feature size of currentTabularDataset.Returns the dataset labels.intGets 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.NDListgetRowFeatures(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.TranslatorOptionsprotected voidPrepares thePreparedFeaturizers.Methods inherited from class ai.djl.training.dataset.RandomAccessDataset
availableSize, getData, getData, getData, getData, newSubDataset, newSubDataset, randomSplit, size, subDataset, subDataset, subDataset, subDataset, toArrayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.djl.training.dataset.Dataset
prepare, prepare
-
Field Details
-
features
-
labels
-
-
Constructor Details
-
TabularDataset
Creates a new instance ofRandomAccessDatasetwith 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:
getin 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 thePreparedFeaturizers. -
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()
-