Class Featurizers


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

      • 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​(boolean onehotEncode)
        Returns the default String Featurizer.
        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 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​(java.lang.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