Class StatsFunctions

java.lang.Object
com.pervasive.datarush.analytics.functions.StatsFunctions

public class StatsFunctions extends Object
Useful statistics related functions.
  • Method Details

    • 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 use
      field - input field to normalize
      numInfo - 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 use
      expr - apply normalization to the result of this function
      numInfo - 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 normalize
      mean - mean of the input data
      stddev - 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 function
      mean - mean of the input data
      stddev - 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 normalize
      mean - mean of the input data
      stddev - 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 function
      mean - mean of the input data
      stddev - 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 normalize
      min - minimum value of the input data
      max - 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 function
      min - minimum value of the input data
      max - 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 normalize
      min - minimum value of the input data
      max - 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 function
      min - minimum value of the input data
      max - maximum value of the input data
      Returns:
      normalization function