Description
N-BEATS is a sophisticated neural-network based model specifically designed for univariate time-series forecasting. It represents a significant contribution from ServiceNow Research, with its origins tracing back to Element AI. The project aims to provide a robust implementation of the N-BEATS algorithm, enabling researchers and practitioners to reproduce experimental results presented in the associated paper.
The repository is structured to facilitate easy access and usage. The core PyTorch implementation of the N-BEATS model can be found within the `models/nbeats.py` file. For data handling, dataset loaders for various datasets used in the paper are located in the `datasets/*.py` directory. The `experiments/*` directory houses the experimental setups required to replicate the paper's results, each containing a `main.py` script for training and forecasting logic, alongside configuration files for both generic and interpretable model variants.
Results and performance metrics are documented in the `notebooks` directory, with a dedicated notebook for each experiment. These notebooks showcase final scores and insights into the effectiveness of different ensemble sizes, noting that smaller ensembles often yield comparable results to larger ones. This implementation is described as a 'lighter' version of the original N-BEATS, offering performance that is generally on the same state-of-the-art level, with occasional variations in results.
The project emphasizes reproducibility through Docker, making it accessible for users with or without NVIDIA GPUs. The `Makefile` provides commands for initializing the Docker image, downloading datasets, running tests, building experiments, and executing forecasts on both CPU and GPU. Detailed instructions are provided for setting up the environment, building the Docker image, downloading datasets, and running experiments with customizable parameters such as repeats and lookback periods. The output of experiments, including logs, losses, snapshots, and final forecasts, is stored in the `storage/experiments` directory.
N-BEATS is particularly valuable for data scientists, machine learning engineers, and researchers involved in time-series analysis, forecasting, and predictive modeling. Its interpretable nature and state-of-the-art performance make it a powerful tool for understanding and predicting future trends in univariate data across various domains.
N-BEATS Highlights
Neural-network based model for univariate time-series forecasting
Implementation of the N-BEATS algorithm
Reproducible experimental results
PyTorch implementation available
Dataset loaders for various datasets
Configuration files for generic and interpretable models
Docker support for environment setup
CPU and GPU execution support
Detailed instructions for reproduction
Storage for experiment logs, losses, and forecasts
Getting Started with N-BEATS
Set up environment: Ensure Docker is installed and adjust Makefile for your environment.
Build Docker image: Run `make init` to build the Docker image.
Download datasets: Execute `make dataset` to download required datasets.
Build an experiment: Use `make build config=<path_to_config.gin>` to generate experiment configurations.
Run experiments: Utilize `make run command=<path_to_command>` for CPU or `make run command=<path_to_command> gpu=<gpu-id>` for GPU.
Get experiment statistics: Run a JupyterLab notebook via `make notebook port=<port>` to analyze performance.
N-BEATS's Use Cases
- Time-series forecasting
- Predictive analytics
- Demand forecasting
- Financial forecasting
- Resource planning







