Class CovarianceFlux

All Implemented Interfaces:
Expression, HasImports

public final class CovarianceFlux extends AbstractParametrizedFlux
Covariance is an aggregate operation. Covariance computes the covariance between two columns. See SPEC.

Options

  • columns - List of columns on which to compute the covariance. Exactly two columns must be provided [array of strings].
  • pearsonr - Indicates whether the result should be normalized to be the Pearson R coefficient [boolean].
  • valueDst - The column into which the result will be placed. Defaults to _value` [string].

Example

 Flux flux = Flux
     .from("telegraf")
     .covariance(new String[]{"_value", "_valueSquare"});
 
Author:
Jakub Bednar (bednar@github) (17/07/2018 13:13)
  • Constructor Details

    • CovarianceFlux

      public CovarianceFlux(@Nonnull Flux source)
  • Method Details

    • operatorName

      @Nonnull protected String operatorName()
      Specified by:
      operatorName in class AbstractParametrizedFlux
      Returns:
      name of function
    • withColumns

      @Nonnull public CovarianceFlux withColumns(@Nonnull String[] columns)
      Parameters:
      columns - list of columns on which to compute the covariance. Exactly two columns must be provided.
      Returns:
      this
    • withColumns

      @Nonnull public CovarianceFlux withColumns(@Nonnull Collection<String> columns)
      Parameters:
      columns - list of columns on which to compute the covariance. Exactly two columns must be provided.
      Returns:
      this
    • withPearsonr

      @Nonnull public CovarianceFlux withPearsonr(boolean pearsonr)
      Parameters:
      pearsonr - Indicates whether the result should be normalized to be the Pearson R coefficient
      Returns:
      this
    • withValueDst

      @Nonnull public CovarianceFlux withValueDst(@Nonnull String valueDst)
      Parameters:
      valueDst - column into which the result will be placed.
      Returns:
      this
    • collectImports

      public void collectImports(@Nonnull Set<String> collectedImports)
      Description copied from class: Flux
      Collects all imports of the flux.
      Overrides:
      collectImports in class Flux
      Parameters:
      collectedImports - a set to be filled by the used imports