Class CsvDataset

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.commons.csv.CSVFormat csvFormat  
      protected java.util.List<org.apache.commons.csv.CSVRecord> csvRecords  
      protected java.net.URL csvUrl  
      • Fields inherited from class ai.djl.training.dataset.RandomAccessDataset

        dataBatchifier, device, labelBatchifier, limit, pipeline, prefetchNumber, sampler, targetPipeline
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected long availableSize()
      static CsvDataset.CsvBuilder<?> builder()
      Creates a builder to build a AmesRandomAccess.
      protected java.lang.String getCell​(long rowIndex, java.lang.String featureName)
      Returns a cell in the dataset.
      java.util.List<java.lang.String> getColumnNames()
      Returns the column names of the CSV file.
      void prepare​(ai.djl.util.Progress progress)
      • Methods inherited from class ai.djl.training.dataset.RandomAccessDataset

        getData, getData, getData, getData, randomSplit, size, 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
    • Field Detail

      • csvUrl

        protected java.net.URL csvUrl
      • csvFormat

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

        protected java.util.List<org.apache.commons.csv.CSVRecord> csvRecords
    • Method Detail

      • getCell

        protected java.lang.String getCell​(long rowIndex,
                                           java.lang.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 java.io.IOException
        Throws:
        java.io.IOException
      • getColumnNames

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