KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost
A comprehensive time-series benchmark evaluating state-of-the-art deep learning architectures (PatchTST, TFT, N-HiTS) against traditional gradient boosting (CatBoost) for accurate 24-hour load prediction.
What this repository is
Comparative analysis of hourly electricity‑load forecasting – a research‑oriented Python code base that trains and evaluates four modern time‑series models on real‑world power‑consumption data:
- PatchTST – a transformer model that works on patched time‑series windows
- Temporal Fusion Transformer (TFT) – a transformer that handles static and dynamic covariates
- N‑HiTS – a hierarchical neural forecasting architecture
- CatBoost – a gradient‑boosting decision‑tree model (the “traditional” baseline)
The authors (researchers from MIREA – Russian Technological University) use the code to compare predictive accuracy, statistical significance and practical suitability of these methods for short‑term (next‑day, hour‑by‑hour) load forecasting. The repository contains data‑pre‑processing scripts, model‑training pipelines, validation routines and visualisation tools that produce the figures and tables reported in their 2026 journal article.
Key components (as described in the README)
| Component | What it does |
|---|---|
| Data handling | Loads a 11‑year hourly dataset (≈97 k records) containing electricity consumption (MW·h) and ambient temperature, performs basic statistical analysis, and splits the series for training/validation. |
| Model implementations | Wrappers around the four algorithms (PatchTST, TFT, N‑HiTS from the Darts library, and CatBoost) that expose a common training‑validation interface. |
| Training & validation | Runs each model on the same training set, evaluates on a hold‑out period, and computes error metrics (e.g., MAPE). |
| Result visualisation | Generates plots such as the consumption distribution, temperature distribution, and forecast vs. actual curves, which are used in the paper. |
| Reproducibility | All code is Python 3.11, uses PyTorch 2.13 for the deep‑learning models, and relies on the Darts time‑series library together with CatBoost and pandas for data manipulation. |
Who might find this useful?
- Energy analysts and utility companies that need a reference implementation for evaluating state‑of‑the‑art load‑forecasting models on their own data.
- Researchers in time‑series machine learning looking for a concrete, reproducible comparison between gradient‑boosting and several transformer‑based architectures.
- Students studying applied ML in power systems who want a ready‑made pipeline to experiment with.
Getting started (based on the README)
- Clone the repo
git clone https://github.com/KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost.git cd Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost - Install dependencies (Python 3.11 required)
pip install -r requirements.txt # the README lists pandas, PyTorch, Darts, CatBoost, etc. - Run the pipeline – the main script (e.g.,
run_experiment.py– name inferred from typical structure) will:- load the provided CSV of hourly consumption and temperature,
- perform the statistical summary shown in the paper,
- train each of the four models,
- evaluate and plot the results.
- Inspect outputs – generated figures (distribution plots, forecast plots) are saved in the
output/folder and can be compared to the figures in the accompanying journal article.
Technical stack (explicitly mentioned)
- Python 3.11
- PyTorch 2.13 – deep‑learning backend for PatchTST, TFT, N‑HiTS
- Darts – high‑level time‑series library that provides the N‑HiTS and TFT implementations
- CatBoost – gradient‑boosting library for the baseline model
- pandas – data loading and preprocessing
License
The project is released under the Apache 2.0 license, allowing free use, modification and distribution with attribution.
Citation
If you use the code or the results, cite the associated article:
Dzgoev A.E., Klimkin E.V., Chernyauskas V.V., Brailovsky A.V., Rezhenkov R.N.
"Прогнозирование нагрузки на каждый час суток с помощью PatchTST и Temporal Fusion Transformer: сравнительный системный анализ с традиционными методами бустинга (CatBoost) и нейросетевыми моделями на базе N‑HiTS".
Известия Кабардино‑Балкарского научного центра РАН, 2026, Vol 28, No 3, pp. 49‑70. DOI: 10.35330/1991-6639-2026-28-3-49-70
Related
- Project
- Project
- Project
- Project