Verteego Doc
  • Getting started
    • About Verteego
    • Sample Use Cases
    • Concepts
  • Data
    • Introduction
    • Datasources
      • URL connector specification
    • Datasets
  • Pipelines
    • Forecasting Pipelines
      • Getting started
      • Configuration
        • Identifying and preparing data
          • calculated_cols
          • cols_type
          • date_col
          • normalize
          • preprocessing
          • prediction_resolution
        • Configuring the Forecasting Algorithm
          • algo_name
          • algo_type
          • algorithm_parameters
          • fit_parameters
          • conditional_algorithm_parameters
        • Building the Training and Prediction Set
          • column_to_predict
          • features
          • input_prediction_columns
        • Using Hyperparameter Tuning for the Model
          • tuning_search_params
          • hyperparameter_tuning_parameters
        • Evaluating the Results of the Forecast
          • scores
        • Modifying the results of the forecast
          • postprocessing
      • Calculators
        • External source
          • get_from_dataset
          • weather
        • Mathematic
          • aggregate_val_group_by_key
          • binary_operation
          • count_rows_by_keys
          • hierarchical_aggregate
          • mathematical_expression
          • unary_operation
          • Moving Average (EWM)
        • Machine Learning
          • pca
          • clustering
          • glmm_encoder
          • one_hot_encode
          • words_similarity
        • Transformation
          • fillna
          • fill_series
          • case_na
          • interval_index
          • constant
          • cyclic
          • replace
        • Temporal
          • bank_holidays_countdown
          • bankholidays
          • date_attributes
          • date_weight
          • day_count
          • duration
          • events_countdown
          • seasonality
          • tsfresh
    • Optimization Pipelines
      • Getting started
      • Configuration
      • Constraints
        • Unary Constraint
        • Binary Constraint
        • Aggregation Constraint
        • Order Constraint
        • Multiplicative Equality Constraint
        • Generate constraints from a Dataset
  • Apps
    • About Apps
    • Recipes
      • Pipelines
      • Datasets
  • Users
    • User roles
  • Best practices
    • Performance analysis and ML model improvement
  • Developers
    • API
    • Change logs
Powered by GitBook
On this page
  1. Pipelines
  2. Forecasting Pipelines
  3. Calculators
  4. Mathematic

Moving Average (EWM)

Description of the EWM calculator that allow to compute moving average.

The Exponential Weighted Function (EWM) calculator is a tool within the Verteego platform that allows users to apply exponential smoothing to a dataset for various statistical operations. The calculator supports multiple methods including mean, variance (var), standard deviation (std), correlation (corr), and covariance (cov).

Input Columns

These are the columns used in the calculation for the exponential weighted function.

  • Names of Columns: Specify the columns that will be used to apply the calculation.

Output Columns

These are the columns that will be added to the dataset as a result of the calculation.

  • Names of Columns: The output columns generated by applying the exponential weighted function to the input columns.

Parameters

This section defines the parameters required for the exponential weighted function calculation.

  1. method:

    • This specifies the method used for smoothing the values in the input columns. The supported methods are:

      • mean: Computes the exponential weighted mean.

      • var: Computes the exponential weighted variance.

      • std: Computes the exponential weighted standard deviation.

      • corr: Computes the exponential weighted correlation.

      • cov: Computes the exponential weighted covariance.

  2. span:

    • Defines the span of the smoothing window, typically in terms of the number of rows considered for the exponential weighting. A larger span results in smoother values, while a smaller span gives more weight to recent values.

  3. values:

    • A list of columns that need to be smoothed. These columns will undergo the exponential weighted smoothing calculation.

  4. sort_by:

    • A list of column names by which the dataset should be sorted before the calculation. Sorting ensures the correct chronological or logical order of the data before applying the smoothing.

  5. group_by:

    • A list of columns used for grouping the data. The smoothing function will be applied to each group individually.


Example in YAML Format

This example demonstrates how to configure the exponential weighted function in YAML format for a typical use case:

yamlCopyEditcalculated_cols:
  qty_sold_ewm:
    method: ewm
    input_columns:
      - qty_sold
      - itemid
      - locid
      - date
    output_columns:
      - qty_sold_ewm
    params:
      span: 4
      method: mean
      values:
        - qty_sold
      sort_by:
        - itemid
        - locid
        - date
      group_by:
        - itemid
        - locid

In this YAML configuration:

  • The exponential weighted function (ewm) is applied to the qty_sold column.

  • The smoothing method used is mean (method: mean).

  • The smoothing window spans over 4 rows (span: 4).

  • The dataset will be sorted by itemid, locid, and date before applying the smoothing (sort_by: [itemid, locid, date]).

  • The smoothing will be applied to the qty_sold column and grouped by itemid and locid (group_by: [itemid, locid]).

  • The output will be stored in the qty_sold_ewm column.


Use Cases

This calculator can be useful in various analytical scenarios where smoothing is needed to make time series data more interpretable or to detect trends. Some use cases include:

  • Sales forecasting: Apply exponential weighted mean or variance to sales data to reduce noise and better capture trends.

  • Demand forecasting: Smooth the demand data to predict future stock levels or adjust replenishment schedules.

  • Financial analysis: Use correlation or covariance for financial data to understand the relationships between different assets or business factors over time.


Benefits

  • Real-time Data Smoothing: Automatically smooth your data to reveal clearer patterns.

  • Enhanced Accuracy: By choosing the right method (mean, var, std, etc.), you can improve decision-making based on the smoothed values.

  • Customizable for Different Data Types: Supports a variety of use cases by adjusting parameters like span, sorting, and grouping.

Previousunary_operationNextMachine Learning

Last updated 4 months ago