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
Nested ClassesModifier and TypeClassDescriptionstatic classCsvDataset.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
FieldsModifier and TypeFieldDescriptionprotected org.apache.commons.csv.CSVFormatprotected List<org.apache.commons.csv.CSVRecord>protected URLFields inherited from class ai.djl.basicdataset.tabular.TabularDataset
features, labelsFields inherited from class ai.djl.training.dataset.RandomAccessDataset
dataBatchifier, device, labelBatchifier, limit, pipeline, prefetchNumber, sampler, targetPipeline -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longstatic CsvDataset.CsvBuilder<?>builder()Creates a builder to build aAmesRandomAccess.Returns a cell in the dataset.Returns the column names of the CSV file.voidprepare(ai.djl.util.Progress progress) Methods inherited from class ai.djl.basicdataset.tabular.TabularDataset
get, getFeatures, getFeatureSize, getLabels, getLabelSize, getRowDirect, getRowFeatures, matchingTranslatorOptions, prepareFeaturizersMethods inherited from class ai.djl.training.dataset.RandomAccessDataset
getData, getData, getData, getData, newSubDataset, newSubDataset, randomSplit, size, subDataset, subDataset, subDataset, subDataset, toArrayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getCellin 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:
availableSizein 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
-