TimeLinear

Description

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

TimeLinear Model Architecture

Image Source: How Much Can Time-related Features Enhance Time Series Forecasting? Chaolv Zeng et al

A model that combines a simple yet efficient module, Time Stamp Forecaster (TimeSter), for effectively encoding time-related features with a linear model.

TimeLinear Model Structure:

  • TimeSter (Time Stamp Forecaster)

    • Encodes time-related features (e.g., year, month, day, hour, minute) to learn cyclical and seasonal patterns in time series data.
    • Input
      • Time-related features extracted from time information (e.g., [2024, 12, 12, 13, 45]).
    • Output
      • A representation generated from time-related features.
  • BonSter

    • Uses past observations of multivariate time series data (value features) to generate predictions.
    • Input
      • Value features of the data.
    • Characteristics
      • Utilizes a linear model by default, but can be replaced with any backbone model if needed.
  • Add DeNorm (Combining Module)

    • Combines the results from TimeSter and BonSter to generate the final prediction.
    • Formula
      • Beta × BonSter Output + (1 - Beta) × TimeSter Output.
      • Beta is a parameter controlling the weight.

API module path

from api.v2.model.TimeLinear import TimeLinear

Parameters

seq_len

  • Specifies the length of the input sequence.
  • Example
    • If data's shape (x,60,x).
    • seq_len = 60

pred_len

  • Specifies the prediction length.
  • Example
    • pred_len = 1

time_dim

  • Specifies the time feature length.
  • Example
    • time_dim = 4

c_out

  • Specifies the output time feature length.
  • It must same pred_len
  • Example
    • c_out = 1

rda

  • Specifies the First reduction factor.
  • Example
    • rda = 1

rdb

  • Specifies the Second reduction factor.
  • Example
    • rdb = 1

Ksize

  • Specifies the conv1d kernel size.
  • Example
    • ksize = 3

beta

  • Specifies the prediction adjustment weight.
  • Example
    • beta = 0.8

Example Sample Code (Python)

Results

Check the entire module code.

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

Back to Top