Package ai.djl.basicdataset.tabular
Class TabularDataset.BaseBuilder<T extends TabularDataset.BaseBuilder<T>>
java.lang.Object
ai.djl.training.dataset.RandomAccessDataset.BaseBuilder<T>
ai.djl.basicdataset.tabular.TabularDataset.BaseBuilder<T>
- Type Parameters:
T- the builder type
- Direct Known Subclasses:
CsvDataset.CsvBuilder
- Enclosing class:
- TabularDataset
public abstract static class TabularDataset.BaseBuilder<T extends TabularDataset.BaseBuilder<T>>
extends ai.djl.training.dataset.RandomAccessDataset.BaseBuilder<T>
Used to build a
TabularDataset.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanFields inherited from class ai.djl.training.dataset.RandomAccessDataset.BaseBuilder
dataBatchifier, device, labelBatchifier, limit, pipeline, prefetchNumber, sampler, targetPipeline -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCategoricalFeature(String name) Adds a categorical feature to the feature set.addCategoricalFeature(String name, boolean onehotEncode) Adds a categorical feature to the feature set.addCategoricalFeature(String name, Map<String, Integer> map, boolean onehotEncode) Adds a categorical feature to the feature set with specified mapping.addCategoricalLabel(String name) Adds a categorical feature to the label set.addCategoricalLabel(String name, boolean onehotEncode) Adds a categorical feature to the label set.addCategoricalLabel(String name, Map<String, Integer> map, boolean onehotEncode) Adds a categorical feature to the feature set with specified mapping.addFeature(Feature... features) Adds the features to the feature set.Adds the features to the label set.addNumericFeature(String name) Adds a numeric feature to the feature set.addNumericFeature(String name, boolean normalize) Adds a numeric feature to the feature set.addNumericLabel(String name) Adds a number feature to the label set.addNumericLabel(String name, boolean normalize) Adds a number feature to the label set.noLabels()Indicates the dataset should not have any labels.Methods inherited from class ai.djl.training.dataset.RandomAccessDataset.BaseBuilder
addTargetTransform, addTransform, getSampler, optDataBatchifier, optDevice, optLabelBatchifier, optLimit, optPipeline, optPrefetchNumber, optTargetPipeline, self, setSampling, setSampling, setSampling
-
Field Details
-
features
-
labels
-
allowNoLabels
protected boolean allowNoLabels
-
-
Constructor Details
-
BaseBuilder
protected BaseBuilder()
-
-
Method Details
-
addFeature
Adds the features to the feature set.- Parameters:
features- the features- Returns:
- this builder
-
addNumericFeature
Adds a numeric feature to the feature set.- Parameters:
name- the feature name- Returns:
- this builder
-
addNumericFeature
Adds a numeric feature to the feature set.- Parameters:
name- the feature namenormalize- true to normalize the column- Returns:
- this builder
-
addCategoricalFeature
Adds a categorical feature to the feature set.- Parameters:
name- the feature name- Returns:
- this builder
-
addCategoricalFeature
Adds a categorical feature to the feature set.- Parameters:
name- the feature nameonehotEncode- true to use onehot encode- Returns:
- this builder
-
addCategoricalFeature
Adds a categorical feature to the feature set with specified mapping.- Parameters:
name- the feature namemap- a map contains categorical value maps to indexonehotEncode- true to use onehot encode- Returns:
- this builder
-
addLabel
Adds the features to the label set.- Parameters:
labels- the labels- Returns:
- this builder
-
addNumericLabel
Adds a number feature to the label set.- Parameters:
name- the label name- Returns:
- this builder
-
addNumericLabel
Adds a number feature to the label set.- Parameters:
name- the label namenormalize- true to normalize the column- Returns:
- this builder
-
addCategoricalLabel
Adds a categorical feature to the label set.- Parameters:
name- the feature name- Returns:
- this builder
-
addCategoricalLabel
Adds a categorical feature to the label set.- Parameters:
name- the feature nameonehotEncode- true if use onehot encode- Returns:
- this builder
-
addCategoricalLabel
Adds a categorical feature to the feature set with specified mapping.- Parameters:
name- the feature namemap- a map contains categorical value maps to indexonehotEncode- true if use onehot encode- Returns:
- this builder
-
noLabels
Indicates the dataset should not have any labels.- Returns:
- this builder
-