Skip to main content

module statsforecast.utils

Global Variables

  • NOGIL
  • CACHE
  • AirPassengers

function generate_series

generate_series(
    n_series: int,
    freq: str = 'D',
    min_length: int = 50,
    max_length: int = 500,
    n_static_features: int = 0,
    equal_ends: bool = False,
    engine: str = 'pandas',
    seed: int = 0
) → Union[DataFrame, DataFrame]
Generate Synthetic Panel Series. Generates n_series of frequency freq of different lengths in the interval [min_length, max_length]. If n_static_features > 0, then each series gets static features with random values. If equal_ends == True then all series end at the same date. Args:
  • n_series (int): Number of series for synthetic panel.
  • freq (str, optional): Frequency of the data, ‘D’ or ‘M’. Defaults to ‘D’.
  • min_length (int, optional): Minimum length of synthetic panel’s series. Defaults to 50.
  • max_length (int, optional): Maximum length of synthetic panel’s series. Defaults to 500.
  • n_static_features (int, optional): Number of static exogenous variables for synthetic panel’s series. Defaults to 0.
  • equal_ends (bool, optional): Series should end in the same date stamp ds. Defaults to False.
  • engine (str, optional): Output Dataframe type (‘pandas’ or ‘polars’). Defaults to ‘pandas’.
  • seed (int, optional): Random seed used for generating the data. Defaults to 0.
Returns:
  • DataFrame: Synthetic panel with columns [unique_id, ds, y] and exogenous.

class results

results(x, fn, nit, simplex)

class ConformalIntervals

Class for storing conformal intervals metadata information. Args:
  • n_windows (int, optional): Number of windows for conformal intervals. Defaults to 2.
  • h (int, optional): Forecasting horizon. Defaults to 1.
  • method (str, optional): Method for conformal intervals. Defaults to “conformal_distribution”.

method __init__

__init__(n_windows: int = 2, h: int = 1, method: str = 'conformal_distribution')