Class Featurizers
- java.lang.Object
-
- ai.djl.basicdataset.tabular.utils.Featurizers
-
public final class Featurizers extends java.lang.Object
A utility class provides helper functions to createFeaturizer
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Featurizer
getEpochDayFeaturizer(java.lang.String datePattern)
Constructs anFeaturizers.EpochDayFeaturizer
for representing dates using the epoch day (number of days since 1970-01-01).static Featurizer
getNumericFeaturizer()
Returns the default numericFeaturizer
.static Featurizer
getNumericFeaturizer(boolean normalize)
Returns the default numericFeaturizer
.static Featurizer
getStringFeaturizer()
Returns the default StringFeaturizer
.static Featurizer
getStringFeaturizer(boolean onehotEncode)
Returns the default StringFeaturizer
.static Featurizer
getStringFeaturizer(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.EpochDayFeaturizer
for 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
-
-