Class Featurizers
- java.lang.Object
-
- ai.djl.basicdataset.tabular.utils.Featurizers
-
public final class Featurizers extends java.lang.ObjectA utility class provides helper functions to createFeaturizer.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FeaturizergetEpochDayFeaturizer(java.lang.String datePattern)Constructs anFeaturizers.EpochDayFeaturizerfor representing dates using the epoch day (number of days since 1970-01-01).static FeaturizergetNumericFeaturizer()Returns the default numericFeaturizer.static FeaturizergetNumericFeaturizer(boolean normalize)Returns the default numericFeaturizer.static FeaturizergetStringFeaturizer()Returns the default StringFeaturizer.static FeaturizergetStringFeaturizer(boolean onehotEncode)Returns the default StringFeaturizer.static FeaturizergetStringFeaturizer(java.util.Map<java.lang.String,java.lang.Integer> map, boolean onehotEncode)Returns a new instance of StringFeaturizer.
-
-
-
Method Detail
-
getNumericFeaturizer
public static Featurizer getNumericFeaturizer()
Returns the default numericFeaturizer.- Returns:
- the default numeric
Featurizer
-
getNumericFeaturizer
public static Featurizer getNumericFeaturizer(boolean normalize)
Returns the default numericFeaturizer.- Parameters:
normalize- true to normalize (with mean and std) the values- Returns:
- the default numeric
Featurizer
-
getStringFeaturizer
public static Featurizer getStringFeaturizer()
Returns the default StringFeaturizer.- Returns:
- the default String
Featurizer
-
getStringFeaturizer
public static Featurizer getStringFeaturizer(boolean onehotEncode)
Returns the default StringFeaturizer.- Parameters:
onehotEncode- true to use onehot encoding- Returns:
- the default String
Featurizer
-
getStringFeaturizer
public static Featurizer getStringFeaturizer(java.util.Map<java.lang.String,java.lang.Integer> map, boolean onehotEncode)
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
public static Featurizer getEpochDayFeaturizer(java.lang.String datePattern)
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
-
-