Class InputUtils


  • public final class InputUtils
    extends Object
    • Constructor Detail

      • InputUtils

        public InputUtils()
    • Method Detail

      • isNull

        public static boolean isNull​(String v)
        Checks whether an input value is considered to be null.
        Parameters:
        v - input string
        Returns:
        True in case if it should be considered as a null
      • stringToDouble

        public static double stringToDouble​(String v)
        Convert an input string to a double. When string is not a double the string is interpreted as Double.NaN
        Parameters:
        v - input value
        Returns:
        the double value of the string if it's valid, Double.NaN otherwise
      • stringToDouble

        public static double stringToDouble​(String v,
                                            double replacement)
        Convert an input string to a double. When string is not a double the string is interpreted as Double.NaN
        Parameters:
        v - input value
        replacement - replacement value to use in case the string is not representing a double value.
        Returns:
        the double value of the string if it's valid, replacement otherwise
      • getSanitizedColumnName

        public static String getSanitizedColumnName​(String name)
      • getDRColumnNames

        public static String[] getDRColumnNames​(String[] columns)
        Get the internal column names for the data set. NOTE: the order of the columns has to be the same as in case of the training data.
        Parameters:
        columns - array of strings representing the column names
        Returns:
        Internal naming of the column names.