DLinear

Description

This API calls the DLinear model, which can be used for time series forecasting.

DLinear Model Architecture

Image Source: Are Transformers Effective for Time Series Forecasting? Ailing Zeng et al

This model is a combination of the time series decomposition method used in Autoformer and FEDformer with a linear layer.

Time Series Decomposition Process:

  • Generate Moving Average.
    • The moving average of the time series data is calculated.
  • Remove Moving Average.
    • The moving average is removed to decompose the data into trend and seasonality components.

Learning Process:

  • Decompose into Trend and Seasonality.
    • After removing the moving average, the data is split into trend and seasonality components for training.
  • Apply Linear Layers to Each Component.
    • A single linear layer is applied to each of the trend and seasonality components for learning.
  • Sum the Two Outputs.
    • The predictions for the trend and seasonality are summed to calculate the final prediction.

API module path

from api.v2.model.DLinear import DLinear

Parameters

Window_size

  • Specifies the length of the input sequence.
  • Example
    • window_size = 10

Forecast_size

  • Specifies the number of time points to predict.
  • Example
    • forecast_size = 1

Kernel size

  • Specifies the kernel size for decomposition.
  • default : 25
  • Example
    • kernel_size = 25

Individual

  • Specifies the whether to use individual linear layers for each feature.
  • default : False
  • Example
    • individual=False

Feature_size

  • Specifies the input feature size.
  • Example
    • If data's shape (x,x,1).
    • feature_size = 1

Use_revin

  • Specifies whether to use RevIN normalization.
  • default : False
  • Example
    • Use_revin = False

Multi_feature

  • Specifies whether to apply a fully connected (FC) layer for multiple features.
  • default : False
  • Example
    • multi_feature = false

Example Sample Code (Python)

Results

Check the entire module code.

datahub/api/v2/model/DLinear.py at main · machbase/datahub
All Industrial IoT DataHub with data visualization and AI source - machbase/datahub

Back to Top