N-BEATS uses stacks of fully-connected blocks that produce both a backward forecast (reconstructing the input) and a forward forecast. Residual connections between blocks let each stack focus on what previous stacks missed. The interpretable variant decomposes into trend and seasonal basis functions. N-HiTS adds hierarchical interpolation for efficiency.
MASE, the scaled error used in the M4 competition where N-BEATS made its name, divides the forecast error by the in-sample error of the naive forecast. Here the naive forecast’s average in-sample error is 2.82, and a three-month forecast scores a MASE of 0.59 — 41% better than naive on the scale of this series. Unlike MAPE it never divides by an actual value.
- Its headline results came on the M4 competition’s univariate series and used large ensembles of models.
- With few series, short histories or important external covariates, simple statistical baselines often hold their own — compare against them before adopting a deep model.
- N-BEATS ignores covariates by design; N-HiTS and others add them.
train = np.array([12, 15, 14, 18, 20, 17, 21, 24, 22, 26, 28, 25.0]) # made up test = np.array([29, 31, 28.0]) forecast = np.array([28, 29, 30.0]) scale = np.abs(np.diff(train)).mean() # in-sample error of the naive forecast mase = np.abs(test - forecast).mean() / scale # < 1 beats naive on the scale of the training data
Assumes import numpy as np and import pandas as pd. Each snippet simulates or makes up its own series, as the comments say.
The same idea with a library
# Python — N-BEATS with Darts from darts.models import NBEATSModel model = NBEATSModel( input_chunk_length=96, output_chunk_length=24, generic_architecture=True, num_stacks=30, num_layers=4 ) model.fit(train_series) pred = model.predict(n=24)
- B. N. Oreshkin, D. Carpov, N. Chapados & Y. Bengio, “N-BEATS: Neural Basis Expansion Analysis for Interpretable Time Series Forecasting”, ICLR, 2020
- S. Makridakis, E. Spiliotis & V. Assimakopoulos, “The M4 Competition: 100,000 Time Series and 61 Forecasting Methods”, International Journal of Forecasting 36(1), 2020
- C. Challu et al., “N-HiTS: Neural Hierarchical Interpolation for Time Series Forecasting”, AAAI, 2023
Last reviewed October 2026 · How this site checks its content · Report a mistake