public final class AirfoilRandomAccess
extends ai.djl.training.dataset.RandomAccessDataset
1503 instances 6 attributes
| Modifier and Type | Class and Description |
|---|---|
static class |
AirfoilRandomAccess.Builder
A builder to construct a
AirfoilRandomAccess. |
| Modifier and Type | Method and Description |
|---|---|
void |
addAllFeatures()
Move all available features to set.
|
void |
addFeature(java.lang.String feature)
Adds a feature if it exists.
|
protected long |
availableSize() |
static AirfoilRandomAccess.Builder |
builder()
Creates a builder to build a
AirfoilRandomAccess. |
protected ai.djl.training.dataset.Record |
get(ai.djl.ndarray.NDManager manager,
long index) |
org.apache.commons.csv.CSVRecord |
getCSVRecord(int index)
Returns the CSVRecord for a given index.
|
int |
getFeatureArraySize()
Returns the size of the feature array(column count).
|
ai.djl.ndarray.NDArray |
getFeatureNDArray(ai.djl.ndarray.NDManager manager,
int index)
Return the NDArray at index 'index' with the set features.
|
java.util.List<java.lang.String> |
getFeatureOrder()
Gets the feature order of the columns.
|
float[] |
getLabel(int index)
Returns the label value for a given index.
|
float |
getRecordFloat(org.apache.commons.csv.CSVRecord record,
java.lang.String feature)
Returns float for a given record and feature.
|
float[] |
getValueFloat(org.apache.commons.csv.CSVRecord record,
java.lang.String feature)
Returns the float value of the record's feature in a float[].
|
void |
prepare(ai.djl.util.Progress progress) |
void |
removeAllFeatures()
Move all currently set features to available.
|
void |
removeFeature(java.lang.String feature)
Removes a feature from the active set if it exists.
|
void |
selectFirstN(int n)
Chooses the 1st N records to be used (not reversible).
|
void |
whitenAll()
Remove mean and rescale variance to 1 for all features.
|
getData, getData, randomSplit, sizepublic void whitenAll()
throws java.io.IOException,
ai.djl.translate.TranslateException
java.io.IOException - for various exceptions depending on the datasetai.djl.translate.TranslateException - if there is an error while processing inputpublic java.util.List<java.lang.String> getFeatureOrder()
public float getRecordFloat(org.apache.commons.csv.CSVRecord record,
java.lang.String feature)
record - record which holds the raw datafeature - feature to be selectedpublic void selectFirstN(int n)
throws java.io.IOException,
ai.djl.translate.TranslateException
TODO: make standalone without need for whiten() after to set data[] (speed penalty)
n - number of records to be used starting from the beginningjava.io.IOException - for various exceptions depending on the datasetai.djl.translate.TranslateException - if there is an error while processing inputpublic static AirfoilRandomAccess.Builder builder()
AirfoilRandomAccess.public float[] getLabel(int index)
index - index of labelprotected ai.djl.training.dataset.Record get(ai.djl.ndarray.NDManager manager,
long index)
get in class ai.djl.training.dataset.RandomAccessDatasetpublic org.apache.commons.csv.CSVRecord getCSVRecord(int index)
index - index of desired recordpublic float[] getValueFloat(org.apache.commons.csv.CSVRecord record,
java.lang.String feature)
record - The CSVRecord to get the feature fromfeature - The feature value to be acquiredpublic int getFeatureArraySize()
public ai.djl.ndarray.NDArray getFeatureNDArray(ai.djl.ndarray.NDManager manager,
int index)
manager - NDManager to maintain created NDArrayindex - Index of wanted NDArraypublic void removeAllFeatures()
public void addAllFeatures()
public void addFeature(java.lang.String feature)
feature - requested featurepublic void removeFeature(java.lang.String feature)
feature - to be removed featurepublic void prepare(ai.djl.util.Progress progress)
throws java.io.IOException
java.io.IOExceptionprotected long availableSize()
availableSize in class ai.djl.training.dataset.RandomAccessDataset