Time Series
How to train and configure a time series model
Overview
Time series models predict future values based on past observations that are ordered in time (for example: daily sales, hourly traffic, or weekly revenue). Unlike standard ML models, time series models are sensitive to time spacing. This means the model must know what one row of data represents (day, hour, week, etc.) and how far back in time it should look when learning patterns. This section explains the key configuration options specific to time series models and how to use them correctly.
Required Columns
Timestamp Column
Required: Yes
The name of the column that contains the date or timestamp for each observation.
- Used to order the data in time
- Must contain valid date or datetime values
- Each row should represent a single point in time
Target Column
Required: Yes
The Target Column is the numeric value the model will learn to predict. This column represents the time-dependent quantity you want to forecast.
Extra Regressors
Required: No
Additional feature columns that may help explain changes in the target value. These features must be known at prediction time or remain constant in the future.
Time Configuration
Frequency
Defines what one row in your dataset represents.
Examples:
D→ one row per dayH→ one row per hourW→ one row per weekM→ one row per month
⚠️ Important:
Frequencymust match the actual spacing of your data.
If your data is daily butFrequencyis set toW, the model will treat each row as one week apart, leading to incorrect lags, rolling features, and forecasts.
If it is not provided, it will be inferred from the timestamps in your data.
Forecast Steps
Determines how many future time periods the model will predict. The unit of each step depends on the selected Frequency.
Examples:
Forecast Steps = 7withFrequency = D→ forecast the next 7 daysForecast Steps = 4withFrequency = W→ forecast the next 4 weeks
Fill Method
How missing timestamps are handled before training.
Available options:
interpolate— linearly interpolate missing valuesffill— forward fill using the last known valuebfill— backward fill using the next known value
Choose a method that aligns with how gaps should reasonably be filled in your data.
Add Lags (Days)
Allows the model to use past values of the target as features. Each value represents how many time steps (rows) back to look, not calendar days.
Examples:
- With
Frequency = DandAdd Lags (Days) = [1, 7]- 1 → yesterday
- 7 → 7 days ago
- With
Frequency = WandAdd Lags (Days) = [1, 7]- 1 → last week
- 7 → 7 weeks ago
Lag features help capture short-term patterns and repeating behavior.
Add Rolling Mean
Adds rolling average features based on recent past values. Each value represents the window size in time steps (rows).
Examples:
- With
Frequency = DandAdd Rolling Mean = [7, 30]- 7 → average of the last 7 days
- 30 → average of the last 30 days
- With
Frequency = WandAdd Rolling Mean = [4]- 4 → average of the last 4 weeks
Rolling means smooth short-term noise and capture the recent overall level of the series.