Package com.datarobot.transform.util
Class InputUtils
- java.lang.Object
-
- com.datarobot.transform.util.InputUtils
-
public final class InputUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description InputUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String[]getDRColumnNames(String[] columns)Get the internal column names for the data set.static StringgetSanitizedColumnName(String name)static booleanisNull(String v)Checks whether an input value is considered to be null.static doublestringToDouble(String v)Convert an input string to a double.static doublestringToDouble(String v, double replacement)Convert an input string to a double.
-
-
-
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 valuereplacement- 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
-
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.
-
-