View Source Soothsayer.Preprocessor (soothsayer v0.3.1)

Provides data preprocessing functionality for the Soothsayer forecasting model.

Summary

Functions

Prepares the input data by adding Fourier terms for yearly and weekly seasonality based on the provided configuration.

Functions

Link to this function

prepare_data(df, y_column, ds_column, seasonality_config)

View Source
@spec prepare_data(Explorer.DataFrame.t(), String.t() | nil, String.t(), map()) ::
  Explorer.DataFrame.t()

Prepares the input data by adding Fourier terms for yearly and weekly seasonality based on the provided configuration.

Parameters

  • df - An Explorer.DataFrame containing the input data.
  • y_column - The name of the target variable column.
  • ds_column - The name of the date column.
  • seasonality_config - A map containing the seasonality configuration.

Returns

An Explorer.DataFrame with additional columns for Fourier terms based on the seasonality configuration.

Examples

iex> df = Explorer.DataFrame.new(%{"ds" => [...], "y" => [...]})
iex> seasonality_config = %{yearly: %{enabled: true, fourier_terms: 6}, weekly: %{enabled: true, fourier_terms: 3}}
iex> prepared_df = Soothsayer.Preprocessor.prepare_data(df, "y", "ds", seasonality_config)
#Explorer.DataFrame<...>