Class Featurizers
java.lang.Object
ai.djl.basicdataset.tabular.utils.Featurizers
A utility class provides helper functions to create
Featurizer.-
Method Summary
Modifier and TypeMethodDescriptionstatic FeaturizergetEpochDayFeaturizer(String datePattern) Constructs anFeaturizers.EpochDayFeaturizerfor representing dates using the epoch day (number of days since 1970-01-01).static FeaturizerReturns the default numericFeaturizer.static FeaturizergetNumericFeaturizer(boolean normalize) Returns the default numericFeaturizer.static FeaturizerReturns the default StringFeaturizer.static FeaturizergetStringFeaturizer(boolean onehotEncode) Returns the default StringFeaturizer.static FeaturizergetStringFeaturizer(Map<String, Integer> map, boolean onehotEncode) Returns a new instance of StringFeaturizer.
-
Method Details
-
getNumericFeaturizer
Returns the default numericFeaturizer.- Returns:
- the default numeric
Featurizer
-
getNumericFeaturizer
Returns the default numericFeaturizer.- Parameters:
normalize- true to normalize (with mean and std) the values- Returns:
- the default numeric
Featurizer
-
getStringFeaturizer
Returns the default StringFeaturizer.- Returns:
- the default String
Featurizer
-
getStringFeaturizer
Returns the default StringFeaturizer.- Parameters:
onehotEncode- true to use onehot encoding- Returns:
- the default String
Featurizer
-
getStringFeaturizer
Returns a new instance of StringFeaturizer.- Parameters:
map- a map contains categorical value maps to indexonehotEncode- true to use onehot encoding- Returns:
- a new instance of String
Featurizer
-
getEpochDayFeaturizer
Constructs anFeaturizers.EpochDayFeaturizerfor representing dates using the epoch day (number of days since 1970-01-01).- Parameters:
datePattern- the pattern that dates are found in the data table column- Returns:
- a new instance of
Featurizers.EpochDayFeaturizer
-