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.
  • Field Details

  • Constructor Details

    • TabularDataset

      public TabularDataset(TabularDataset.BaseBuilder<?> builder)
      Creates a new instance of RandomAccessDataset with the given necessary configurations.
      Parameters:
      builder - a builder with the necessary configurations
  • Method Details

    • getFeatureSize

      public int getFeatureSize()
      Gets the feature size of current TabularDataset.
      Returns:
      the feature size
    • getLabelSize

      public int getLabelSize()
      Gets the label size of current TabularDataset.
      Returns:
      the feature size
    • getFeatures

      public List<Feature> getFeatures()
      Returns the dataset features.
      Returns:
      the dataset features
    • getLabels

      public 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:
      get in class ai.djl.training.dataset.RandomAccessDataset
    • getRowDirect

      public List<String> getRowDirect(long index, List<Feature> selected)
      Returns the direct designated features (either data or label features) from a row.
      Parameters:
      index - the index of the requested data item
      selected - 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 arrays
      index - the index of the requested data item
      selected - the features to pull from the row
      Returns:
      the features formatted as an NDList
    • prepareFeaturizers

      protected void prepareFeaturizers()
      Prepares the PreparedFeaturizers.
    • getCell

      public abstract String getCell(long rowIndex, String featureName)
      Returns a cell in the dataset.
      Parameters:
      rowIndex - the row index or record index for the cell
      featureName - 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()