Class FeatureUtil


  • public class FeatureUtil
    extends Object
    • Constructor Detail

      • FeatureUtil

        public FeatureUtil()
    • Method Detail

      • toOutcomeVector

        public static INDArray toOutcomeVector​(long index,
                                               long numOutcomes)
        Creates an out come vector from the specified inputs
        Parameters:
        index - the index of the label
        numOutcomes - the number of possible outcomes
        Returns:
        a binary label matrix used for supervised learning
      • toOutcomeMatrix

        public static INDArray toOutcomeMatrix​(int[] index,
                                               long numOutcomes)
        Creates an out come vector from the specified inputs
        Parameters:
        index - the index of the label
        numOutcomes - the number of possible outcomes
        Returns:
        a binary label matrix used for supervised learning
      • normalizeMatrix

        public static void normalizeMatrix​(INDArray toNormalize)
      • scaleByMax

        public static void scaleByMax​(INDArray toScale)
        Divides each row by its max
        Parameters:
        toScale - the matrix to divide by its row maxes
      • scaleMinMax

        public static void scaleMinMax​(double min,
                                       double max,
                                       INDArray toScale)
        Scales the ndarray columns to the given min/max values
        Parameters:
        min - the minimum number
        max - the max number