Class CsvDataset

java.lang.Object
ai.djl.training.dataset.RandomAccessDataset
ai.djl.basicdataset.tabular.TabularDataset
ai.djl.basicdataset.tabular.CsvDataset
All Implemented Interfaces:
ai.djl.training.dataset.Dataset
Direct Known Subclasses:
AirfoilRandomAccess, AmazonReview, AmesRandomAccess, DailyDelhiClimate, MovieLens100k

public class CsvDataset extends TabularDataset
CsvDataset represents the dataset that stored in a .csv file.
  • Field Details

    • csvUrl

      protected URL csvUrl
    • csvFormat

      protected org.apache.commons.csv.CSVFormat csvFormat
    • csvRecords

      protected List<org.apache.commons.csv.CSVRecord> csvRecords
  • Constructor Details

  • Method Details

    • getCell

      public String getCell(long rowIndex, String featureName)
      Returns a cell in the dataset.
      Specified by:
      getCell in class TabularDataset
      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
    • availableSize

      protected long availableSize()
      Specified by:
      availableSize in class ai.djl.training.dataset.RandomAccessDataset
    • prepare

      public void prepare(ai.djl.util.Progress progress) throws IOException
      Throws:
      IOException
    • builder

      public static CsvDataset.CsvBuilder<?> builder()
      Creates a builder to build a AmesRandomAccess.
      Returns:
      a new builder
    • getColumnNames

      public List<String> getColumnNames()
      Returns the column names of the CSV file.
      Returns:
      a list of column name