ETNA Time Series Forecasting Framework

repository·master·Indexed 41 days ago

https://github.com/etna-team/etna

An open-source Python framework by T-Bank AI Center for time series forecasting. It provides a unified Pipeline API for preprocessing (transforms), feature engineering, and predictive models ranging from classic ML to SOTA neural networks like DeepAR, TFT, N-BEATS, PatchTST, Chronos, and TimesFM. Version 3.0.0 includes support for hierarchical time series, AutoML, Optuna and WandB integration, and advanced outlier detection.

Tokens
23.9K
Snippets
63
Records
132
Agent score
47%

What's inside ETNA

  1. Available test datasets in ETNA

    master

    The examples/data/ directory contains sample CSV files used for testing various ETNA functionalities. These datasets can be used to verify pipeline behavior, model fitting, and forecasting capabilities.

    • nordic_merch_sales.csv: Sales data from the Kaggle Tabular Playground Series (Jan 2022).
    • nordic_weather.csv: Weather data for Finland, Norway, and Sweden (2015-2019).
  2. Use the etna.pipeline module for time series forecasting

    master
    The etna.pipeline module provides the core abstractions for building, managing, and executing time series forecasting workflows. It includes base classes for defining pipelines, specialized pipeline implementations for different forecasting strategies, and utilities for backtesting and assembly.
  3. Explore Etna tutorials by proficiency level

    master

    Etna provides a structured learning path through tutorials categorized by proficiency level:

    Basic Tutorials

    For users just starting with the library:

    • Get Started: Initial introduction to the library.
    • Backtest: How to evaluate a pipeline's performance.
    • Exploratory data analysis (EDA): How to perform EDA using Etna.

    Intermediate Tutorials

    For users looking to implement specific time series techniques:

    • Regressors and exogenous data: Using exogenous data in a pipeline.
    • Deep learning examples: Working with neural network models.
    • Ensembles: How to ensemble multiple pipelines.
    • Outliers: Handling outliers in time series.
    • AutoML: Using AutoML utilities.
    • Clustering: Performing time series clustering.
    • Feature selection: Performing feature selection.
    • Forecasting strategies: Using different forecasting strategies.
    • Mechanics of forecasting: Understanding how pipelines make forecasts under the hood.
    • Embedding models: Using embedding models.

    Advanced Tutorials

    For complex production and research use cases:

    • Custom model and transform: Defining your own models and transforms.
    • Inference: Saving a pipeline and using it later on new data.
    • Hierarchical time series: Working with hierarchical time series structures.
    • Forecasting interpretation: Performing forecast decomposition for interpretation.
    • Classification: Performing time series classification.
    • Prediction intervals: Estimating prediction intervals.
    • Working with misaligned data: Handling misaligned data in your pipelines.
  4. Execute automated tasks using Runners

    master

    Runners are responsible for the actual execution of the automated forecasting tasks. You can choose between different execution strategies:

    • runner.AbstractRunner: The base class for all runner implementations.
    • runner.LocalRunner: Executes tasks locally on the current machine.
    • runner.ParallelLocalRunner: Executes tasks locally using parallel processing to speed up execution.
  5. Use decomposition transforms for time series components

    master

    Decomposition transforms are used to break down a time series into its constituent parts like trend, seasonality, and change points.

    Key transforms include:

    • Trend extraction: TrendTransform, LinearTrendTransform, TheilSenTrendTransform, and STLTransform.
    • Seasonality removal: DeseasonalityTransform.
    • Change point detection: ChangePointsLevelTransform, ChangePointsSegmentationTransform, and ChangePointsTrendTransform.
    • Frequency domain: FourierDecomposeTransform.
    • Model-based decomposition: ModelDecomposeTransform using models like RupturesChangePointsModel, StatisticsPerIntervalModel, MeanPerIntervalModel, MedianPerIntervalModel, SklearnPreprocessingPerIntervalModel, or SklearnRegressionPerIntervalModel.
  6. Identify core Etna entities: Model, Transform, and Pipeline

    master

    The Etna library is built around three primary high-level entities:

    • Model: An entity used for learning time series patterns to perform forecasting. (See api_reference/models)
    • Transform: An entity used for performing transformations on a dataset. (See api_reference/transforms)
    • Pipeline: A high-level entity that orchestrates the forecasting task by working with a dataset, model, transforms, and other pipelines.
  7. Use Ensembles for time series forecasting

    master

    Etna provides ensemble methods to combine multiple forecasting models into a single, more robust prediction. Instead of relying on a single model, ensembles like DirectEnsemble, StackingEnsemble, and VotingEnsemble aggregate predictions to improve accuracy and stability.

    Available ensemble types in etna.ensembles include:

    • DirectEnsemble: Likely uses direct forecasting approaches.
    • StackingEnsemble: Uses a meta-model to learn how to best combine the predictions of base models.
    • VotingEnsemble: Combines predictions based on a voting mechanism (e.g., averaging or majority rule).
  8. Distinguish between endogenous and exogenous data

    master

    When preparing data for forecasting, it is important to distinguish between the variables you are modeling and the variables you use to help the model:

    • Endogenous data: The variables you want to model. This is often referred to as the target.
    • Exogenous data: Additional variables in a dataset that help model the target.
    • Regressor: An exogenous variable whose values are known in the future during the forecasting process.