- 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 class
StatsFunctions.NormalizeMethod
Supported methods of value normalization.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ScalarValuedFunction
minmax(ScalarValuedFunction expr, double min, double max)
Create a MinMax normalization function for the given subexpression.static ScalarValuedFunction
minmax(ScalarValuedFunction expr, BigDecimal min, BigDecimal max)
Create a MinMax normalization function for the given subexpression.static ScalarValuedFunction
minmax(String field, double min, double max)
Create a MinMax normalization function for the input field.static ScalarValuedFunction
minmax(String field, BigDecimal min, BigDecimal max)
Create a MinMax normalization function for the input field.static ScalarValuedFunction
normalizeFunction(StatsFunctions.NormalizeMethod method, ScalarValuedFunction expr, AbstractNumericInfo<?> numInfo)
Create a normalization function for the given function expression.static ScalarValuedFunction
normalizeFunction(StatsFunctions.NormalizeMethod method, String field, AbstractNumericInfo<?> numInfo)
Create a normalization function for the given input field.static ScalarValuedFunction
zscore(ScalarValuedFunction expr, double mean, double stddev)
Create a Z-Score normalization function for the given input function.static ScalarValuedFunction
zscore(ScalarValuedFunction expr, BigDecimal mean, BigDecimal stddev)
Create a Z-Score normalization function for the given input function.static ScalarValuedFunction
zscore(String field, double mean, double stddev)
Create a Z-Score normalization function for the input field.static ScalarValuedFunction
zscore(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
-
-