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.RandomAccessDatasetA abstract class for creating tabular datasets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTabularDataset.BaseBuilder<T extends TabularDataset.BaseBuilder<T>>Used to build aTabularDataset.
-
Constructor Summary
Constructors Constructor Description TabularDataset(TabularDataset.BaseBuilder<?> builder)Creates a new instance ofRandomAccessDatasetwith the given necessary configurations.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ai.djl.training.dataset.Recordget(ai.djl.ndarray.NDManager manager, long index)abstract java.lang.StringgetCell(long rowIndex, java.lang.String featureName)Returns a cell in the dataset.java.util.List<Feature>getFeatures()Returns the dataset features.intgetFeatureSize()Gets the feature size of currentTabularDataset.java.util.List<Feature>getLabels()Returns the dataset labels.intgetLabelSize()Gets the label size of currentTabularDataset.ai.djl.ndarray.NDListgetRowFeatures(ai.djl.ndarray.NDManager manager, long index, java.util.List<Feature> selected)Returns the designated features (either data or label features) from a row.ai.djl.translate.TranslatorOptionsmatchingTranslatorOptions()protected voidprepareFeaturizers()Prepares thePreparedFeaturizers.-
Methods inherited from class ai.djl.training.dataset.RandomAccessDataset
availableSize, getData, getData, getData, getData, newSubDataset, newSubDataset, randomSplit, size, subDataset, subDataset, subDataset, subDataset, toArray
-
-
-
-
Constructor Detail
-
TabularDataset
public TabularDataset(TabularDataset.BaseBuilder<?> builder)
Creates a new instance ofRandomAccessDatasetwith the given necessary configurations.- Parameters:
builder- a builder with the necessary configurations
-
-
Method Detail
-
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
public java.util.List<Feature> getFeatures()
Returns the dataset features.- Returns:
- the dataset features
-
getLabels
public java.util.List<Feature> 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
-
getRowFeatures
public ai.djl.ndarray.NDList getRowFeatures(ai.djl.ndarray.NDManager manager, long index, java.util.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
public abstract java.lang.String getCell(long rowIndex, java.lang.String featureName)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()
-
-