liveBook · Manning

Pretraining

As explained in Time Series Forecasting Using Foundation Models

Pretraining is initial training of a model on a large dataset to learn general patterns and relationships before applying it to specific tasks.

Pretraining trains a model on a large, varied dataset so it learns general patterns before being applied to a specific task. Applying that model to an unseen problem is transfer learning. section 2.3

Pretraining supports practical forecasting decisions by:

  • Using learned patterns when a target series lacks enough history, such as forecasting sales for a new product. section 2.3
  • Depending on dataset variety, frequency coverage, and prediction horizons: a model generalizes less reliably outside the conditions it saw during training. section 4.1.2
  • Balancing model size, training steps, inference speed, memory, computational power, and predictive performance. section 6.1.2

Pretraining N-BEATS

A monthly N-BEATS model can take 24 months of input to predict the next 12 months, train for 1,000 gradient-update steps on the monthly M3 dataset, and then be saved for transfer learning. section 2.4

Pretraining does not guarantee strong zero-shot forecasts. Lag-Llama, for example, was trained on daily-to-minute data and horizons of 24–60 steps, so weekly, monthly, quarterly, or longer-horizon use may require fine-tuning. section 4.1.2

Listing 2.3 Initializing the N-BEATS model
from neuralforecast.core import NeuralForecast
from neuralforecast.models import NBEATS

horizon = 12

models = [
    NBEATS(
        input_size=2*horizon,  #1
        h=horizon,  #2
        max_steps=1000)  #3
]

Inspect the N-BEATS configuration showing how input size, forecast horizon, and maximum training steps operationalize pretraining. section 2.4

How Time Series Forecasting Using Foundation Models covers it

How deep it goes
Explains dataset coverage, windows, horizons, gradient steps, saving, and transfer learning, while stopping short of detailed optimization internals.
Examples
Uses monthly M3 data, N-BEATS, Lag-Llama, Moirai, and forecasting for a new product with scarce history.
What you can do after
Apply a pretrained model to an unseen forecasting task and save or fine-tune it when coverage or data adequacy is insufficient.
How it connects
Connects pretraining to foundation models, transfer learning, fine-tuning, zero-shot forecasting, and time-series forecasting.

Also explained in

Compare how 14 books explain pretraining →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Time Series Forecasting Using Foundation Models. The section links point to the parts of the book it draws on.