- java.lang.Object
-
- com.pervasive.datarush.analytics.functions.StatsFunctions
-
public class StatsFunctions extends Object
Useful statistics related functions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStatsFunctions.NormalizeMethodSupported methods of value normalization.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ScalarValuedFunctionminmax(ScalarValuedFunction expr, double min, double max)Create a MinMax normalization function for the given subexpression.static ScalarValuedFunctionminmax(ScalarValuedFunction expr, BigDecimal min, BigDecimal max)Create a MinMax normalization function for the given subexpression.static ScalarValuedFunctionminmax(String field, double min, double max)Create a MinMax normalization function for the input field.static ScalarValuedFunctionminmax(String field, BigDecimal min, BigDecimal max)Create a MinMax normalization function for the input field.static ScalarValuedFunctionnormalizeFunction(StatsFunctions.NormalizeMethod method, ScalarValuedFunction expr, AbstractNumericInfo<?> numInfo)Create a normalization function for the given function expression.static ScalarValuedFunctionnormalizeFunction(StatsFunctions.NormalizeMethod method, String field, AbstractNumericInfo<?> numInfo)Create a normalization function for the given input field.static ScalarValuedFunctionzscore(ScalarValuedFunction expr, double mean, double stddev)Create a Z-Score normalization function for the given input function.static ScalarValuedFunctionzscore(ScalarValuedFunction expr, BigDecimal mean, BigDecimal stddev)Create a Z-Score normalization function for the given input function.static ScalarValuedFunctionzscore(String field, double mean, double stddev)Create a Z-Score normalization function for the input field.static ScalarValuedFunctionzscore(String field, BigDecimal mean, BigDecimal stddev)Create a Z-Score normalization function for the input field.
-
-
-
Method Detail
-
normalizeFunction
public static ScalarValuedFunction normalizeFunction(StatsFunctions.NormalizeMethod method, String field, AbstractNumericInfo<?> numInfo)
Create a normalization function for the given input field.- Parameters:
method- the method to usefield- input field to normalizenumInfo- numerical statistics of the input field- Returns:
- normalization function
-
normalizeFunction
public static ScalarValuedFunction normalizeFunction(StatsFunctions.NormalizeMethod method, ScalarValuedFunction expr, AbstractNumericInfo<?> numInfo)
Create a normalization function for the given function expression.- Parameters:
method- the method to useexpr- apply normalization to the result of this functionnumInfo- numerical statistics of the input field- Returns:
- normalization function
-
zscore
public static ScalarValuedFunction zscore(String field, double mean, double stddev)
Create a Z-Score normalization function for the input field.- Parameters:
field- input field to normalizemean- mean of the input datastddev- standard deviation of the input data- Returns:
- normalization function
-
zscore
public static ScalarValuedFunction zscore(ScalarValuedFunction expr, double mean, double stddev)
Create a Z-Score normalization function for the given input function.- Parameters:
expr- apply normalization to the result of this functionmean- mean of the input datastddev- standard deviation of the input data- Returns:
- normalization function
-
zscore
public static ScalarValuedFunction zscore(String field, BigDecimal mean, BigDecimal stddev)
Create a Z-Score normalization function for the input field.- Parameters:
field- input field to normalizemean- mean of the input datastddev- standard deviation of the input data- Returns:
- normalization function
-
zscore
public static ScalarValuedFunction zscore(ScalarValuedFunction expr, BigDecimal mean, BigDecimal stddev)
Create a Z-Score normalization function for the given input function.- Parameters:
expr- apply normalization to the result of this functionmean- mean of the input datastddev- standard deviation of the input data- Returns:
- normalization function
-
minmax
public static ScalarValuedFunction minmax(String field, double min, double max)
Create a MinMax normalization function for the input field.- Parameters:
field- input field to normalizemin- minimum value of the input datamax- maximum value of the input data- Returns:
- normalization function
-
minmax
public static ScalarValuedFunction minmax(ScalarValuedFunction expr, double min, double max)
Create a MinMax normalization function for the given subexpression.- Parameters:
expr- apply normalization to the result of this functionmin- minimum value of the input datamax- maximum value of the input data- Returns:
- normalization function
-
minmax
public static ScalarValuedFunction minmax(String field, BigDecimal min, BigDecimal max)
Create a MinMax normalization function for the input field.- Parameters:
field- input field to normalizemin- minimum value of the input datamax- maximum value of the input data- Returns:
- normalization function
-
minmax
public static ScalarValuedFunction minmax(ScalarValuedFunction expr, BigDecimal min, BigDecimal max)
Create a MinMax normalization function for the given subexpression.- Parameters:
expr- apply normalization to the result of this functionmin- minimum value of the input datamax- maximum value of the input data- Returns:
- normalization function
-
-