SeasonalityTransformer<T>

Models & Types · AiDotNet.Preprocessing.TimeSeries

Generates seasonality and calendar features for time series data.

Inheritance: TimeSeriesTransformerBase<T> → SeasonalityTransformer<T>

For Beginners

Many real-world patterns repeat over time:

  • Daily patterns: Energy usage peaks in morning/evening
  • Weekly patterns: Retail sales higher on weekends
  • Monthly patterns: Bill payments cluster at month start/end
  • Yearly patterns: Tourism peaks in summer, retail peaks in December

This transformer creates numerical features that help ML models learn these patterns. For example, instead of just knowing “it’s Monday”, the model gets:

  • Day of week = 1 (Monday)
  • Is weekend = 0 (no)
  • Sin/Cos waves that smoothly encode the position in the week

How It Works

This transformer creates features that capture time-based patterns including:

  • Fourier features for smooth cyclical patterns
  • Calendar features (hour, day, week, month, quarter, year)
  • Holiday and event features
  • Trading day features for financial data

Constructors

Constructor Summary
SeasonalityTransformer(TimeSeriesFeatureOptions options) Creates a new seasonality transformer with the specified options.

Properties

Property Summary
bool SupportsInverseTransform { get; }
int SeasonalityFeatureCount { get; } Gets the number of output features per time step.