Class Featurizers

java.lang.Object
ai.djl.basicdataset.tabular.utils.Featurizers

public final class Featurizers extends Object
A utility class provides helper functions to create Featurizer.
  • Method Details

    • getNumericFeaturizer

      public static Featurizer getNumericFeaturizer()
      Returns the default numeric Featurizer.
      Returns:
      the default numeric Featurizer
    • getNumericFeaturizer

      public static Featurizer getNumericFeaturizer(boolean normalize)
      Returns the default numeric Featurizer.
      Parameters:
      normalize - true to normalize (with mean and std) the values
      Returns:
      the default numeric Featurizer
    • getStringFeaturizer

      public static Featurizer getStringFeaturizer()
      Returns the default String Featurizer.
      Returns:
      the default String Featurizer
    • getStringFeaturizer

      public static Featurizer getStringFeaturizer(boolean onehotEncode)
      Returns the default String Featurizer.
      Parameters:
      onehotEncode - true to use onehot encoding
      Returns:
      the default String Featurizer
    • getStringFeaturizer

      public static Featurizer getStringFeaturizer(Map<String,Integer> map, boolean onehotEncode)
      Returns a new instance of String Featurizer.
      Parameters:
      map - a map contains categorical value maps to index
      onehotEncode - true to use onehot encoding
      Returns:
      a new instance of String Featurizer
    • getEpochDayFeaturizer

      public static Featurizer getEpochDayFeaturizer(String datePattern)
      Constructs an Featurizers.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