Package ai.djl.basicdataset.tabular
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
CsvDataset
represents the dataset that stored in a .csv file.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
CsvDataset.CsvBuilder<T extends CsvDataset.CsvBuilder<T>>
Used to build aCsvDataset
.Nested classes/interfaces inherited from class ai.djl.basicdataset.tabular.TabularDataset
TabularDataset.BaseBuilder<T extends TabularDataset.BaseBuilder<T>>
Nested classes/interfaces inherited from interface ai.djl.training.dataset.Dataset
ai.djl.training.dataset.Dataset.Usage
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.apache.commons.csv.CSVFormat
protected List<org.apache.commons.csv.CSVRecord>
protected URL
Fields inherited from class ai.djl.basicdataset.tabular.TabularDataset
features, labels
Fields inherited from class ai.djl.training.dataset.RandomAccessDataset
dataBatchifier, device, labelBatchifier, limit, pipeline, prefetchNumber, sampler, targetPipeline
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected long
static CsvDataset.CsvBuilder<?>
builder()
Creates a builder to build aAmesRandomAccess
.Returns a cell in the dataset.Returns the column names of the CSV file.void
prepare
(ai.djl.util.Progress progress) Methods inherited from class ai.djl.basicdataset.tabular.TabularDataset
get, getFeatures, getFeatureSize, getLabels, getLabelSize, getRowDirect, getRowFeatures, matchingTranslatorOptions, prepareFeaturizers
Methods inherited from class ai.djl.training.dataset.RandomAccessDataset
getData, getData, getData, getData, newSubDataset, newSubDataset, randomSplit, size, subDataset, subDataset, subDataset, 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 Details
-
csvUrl
-
csvFormat
protected org.apache.commons.csv.CSVFormat csvFormat -
csvRecords
-
-
Constructor Details
-
CsvDataset
-
-
Method Details
-
getCell
Returns a cell in the dataset.- Specified by:
getCell
in classTabularDataset
- 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
-
availableSize
protected long availableSize()- Specified by:
availableSize
in classai.djl.training.dataset.RandomAccessDataset
-
prepare
- Throws:
IOException
-
builder
Creates a builder to build aAmesRandomAccess
.- Returns:
- a new builder
-
getColumnNames
Returns the column names of the CSV file.- Returns:
- a list of column name
-