Open-source project
KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost avatar
KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost

PatchTST, TFT, N-HiTS and CatBoost for 24-hour load forecasting

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.

1,765 stars0 forksPythonApache-2.0

At a glance

What is it?
This Python repository compares four forecasting approaches for hourly electricity load, covering preprocessing, training, validation and visualization. It is most relevant to energy researchers who want to reproduce the comparison rather than adopt a packaged forecasting service.
Who is it for?
Researchers reproducing the published 24-hour load comparison should start with this repository, while production teams needing a maintained prediction service or documented deployment interface should look elsewhere. Verify the data format, model configuration, validation split and generated forecast artifacts before adopting the workflow.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 90 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What the PatchTST, TFT, N-HiTS and CatBoost benchmark addresses

This repository targets a specific forecasting problem: predicting electricity consumption for each hour of the next day. Its intended audience is energy-market researchers, data scientists working with enterprise consumption, and engineers comparing machine learning approaches against established statistical methods such as ARIMA and SARIMAX. The central question is model selection under limited information, rather than construction of a general-purpose forecasting platform.

Four models form the comparison: PatchTST, Temporal Fusion Transformer, N-HiTS and CatBoost. The first three are neural forecasting architectures, while CatBoost represents gradient boosting. That mix makes the repository useful for asking whether the additional complexity of neural models is justified for an hourly load series. The README says the project supports decision-making in energy markets, but it does not present itself as a market integration package, live data connector or trading system.

The repository is associated with a 2026 research article published in the proceedings of the Kabardino-Balkar Scientific Centre of the Russian Academy of Sciences. It is therefore primarily a research reproduction and comparative analysis. Its published context may appeal to academic users, but the README does not claim that the code is a turnkey operational service.

Repository flow from input data to hourly model comparison

The top-level layout separates the benchmark into `Data/`, `Photo/`, `Utils/`, `main.py` and `requirements.txt`. Based on this layout, `main.py` is the central executable entry point, `Utils/` contains supporting code, `Data/` holds project data, and `Photo/` holds image assets associated with results or documentation. The repository does not document an API, background service or command-line interface in the README.

According to the README, the implemented workflow includes data preprocessing, model training, validation and visualization. It also says the system supports prediction of electricity consumption for each hour of the following day. Those stages describe a complete experimental pipeline rather than a single model call. However, the README does not identify the input column names, timestamp format, forecast window configuration, scaling procedure, train and validation boundary, loss function, optimizer, random seed or metric calculation code.

The model names imply different model families, but the README does not expose their configuration. It does not explain how PatchTST input patches are constructed, which TFT variables are treated as known or observed, or how N-HiTS blocks are configured. CatBoost is likewise described as a comparison participant without publishing its feature table or objective. Engineers should therefore treat model architecture details as repository code to inspect, not as documented interfaces that can be configured from the README alone.

Python environment and the limit of the documented setup

The repository declares Python 3.11 and pins its direct dependencies in `requirements.txt`. The pins cover numerical processing, plotting, Excel input, forecasting, neural networks and gradient boosting. This is enough to identify the intended software stack, but the README does not provide installation commands, environment creation steps or a documented invocation for `main.py`.

Because no setup command is documented, this article does not invent a `pip`, `conda` or `python main.py` command. A first real use also cannot be presented responsibly without knowing the required arguments, the expected data files or the names of outputs. The concrete starting point for an engineer is the pinned `requirements.txt`, followed by inspection of `main.py` and `Data/` to determine whether the environment and data match the experiment.

The dependency set is relatively broad. `torch`, `pytorch-lightning`, `gluonts` and `u8darts[torch]` serve neural forecasting workflows, while `catboost` supplies the boosted-tree alternative. `pandas`, `numpy`, `scipy`, `openpyxl` and `statsmodels` indicate that data processing and statistical comparison are part of the broader workflow. Installation may therefore require more disk space and dependency coordination than a minimal forecasting script, although the repository does not publish resource requirements.

Validation constraints for next-day electricity load

The clearest methodological risk is temporal leakage. A model intended to predict every hour of the next day must be trained and validated according to time order. If preprocessing statistics, feature construction or validation windows draw information from later observations, reported error can overstate forecasting performance. The README states that validation is included, but it does not document the split policy or safeguards against leakage.

Hourly load also has strong calendar structure. Day-of-week, hour of day, holidays, temperature and unusual operating periods can alter demand, but the README does not confirm which calendar or external variables are used. That omission matters because TFT can accommodate declared future covariates, while PatchTST and N-HiTS configurations may rely on different input assumptions. CatBoost performance also depends heavily on whether it receives comparable temporal and exogenous features.

The project calls the task prediction for the next day, but the README does not state whether that means exactly 24 values, how missing hours are handled, or how daylight-saving changes and incomplete days affect the series. It also does not define the primary selection metric or explain statistical significance across model runs. These omissions limit the conclusions that can be drawn from repository adoption without reviewing `main.py`, `Utils/` and the study outputs.

CatBoost as the simpler comparison against neural forecasting

CatBoost is the meaningful alternative within this repository. It follows a different approach from PatchTST, TFT and N-HiTS: instead of training a neural forecasting architecture through PyTorch-oriented components, it uses gradient-boosted trees over tabular features. That can make it a useful control because it does not require adopting the same neural forecasting stack.

The README does not document CatBoost parameters, early stopping behavior, feature importance analysis or resource consumption. It also does not claim that CatBoost wins the comparison. Consequently, the project should not be read as evidence that neural forecasting is always preferable. Its value is the side-by-side experimental structure, which lets a researcher compare several model families under the same stated forecasting objective.

There is also a broader operational distinction. This repository is an analysis codebase with data, utilities, a main script and visualizations. Conventional forecasting services commonly expose a maintained API, scheduled ingestion, monitoring and deployment contracts, but this project does not document those facilities. For teams needing continuous electricity-load prediction, CatBoost could be the closer starting architecture if they already have a production pipeline, while the neural models are more relevant to researchers studying their forecasting behavior.

Apache-2.0 licensing, release state and upgrade work

The repository declares the Apache-2.0 license. That identifier defines the stated licensing framework for use, modification and distribution, subject to the license text and applicable obligations. This review does not provide legal advice. Teams should read the repository's `LICENSE` file and confirm how they intend to use the code, data and publication materials.

The latest listed release is `v1.0.0`, dated 2026-04-08. The last push was on 2026-07-25, and the repository is not archived. Those repository facts support describing it as recently changed, but they do not establish production support, release cadence or compatibility with future Python and PyTorch releases.

Upgrade work is likely to require attention because every direct dependency is pinned. Exact pins can improve experiment reproducibility, yet they also mean that adopting the project on a newer platform may require controlled dependency updates. The README does not document a migration policy, supported operating system versions beyond the Windows and Linux badges, or a procedure for moving from the older package versions. The fixed dependency versions should therefore be preserved when reproducing the study.

What the research comparison leaves unverified

The repository is described as a comparative benchmark, but the README does not provide enough implementation detail to verify that a user can reproduce a model result without reading the source. Missing details include data provenance, input schema, split construction, feature definitions, hyperparameters, metric formulas, random seeds and expected output files. The `Data/` directory indicates that data is included in the repository structure, yet the README does not describe its volume, licensing status or expected preprocessing state.

The associated publication adds research context and a DOI, but it is not a substitute for code-level reproducibility instructions. A user also cannot determine from the README whether the visualization stage produces publication figures only or reusable forecast intervals. Uncertainty handling, missing-value treatment and retraining behavior are not documented.

For an academic reproduction, these gaps narrow the intended audience. The project fits a researcher willing to inspect the implementation and reconstruct undocumented experiment conditions. It does not fit a production team expecting a stable input contract and clear operational outputs. Its strongest concrete use is comparative analysis of PatchTST, TFT, N-HiTS and CatBoost under the repository's hourly load workflow.

Editorial conclusion

Researchers reproducing the published 24-hour load comparison should start with this repository, while production teams needing a maintained prediction service or documented deployment interface should look elsewhere. Verify the data format, model configuration, validation split and generated forecast artifacts before adopting the workflow.

Frequently asked questions

What models does the PatchTST, TFT, N-HiTS and CatBoost repository compare?

It compares PatchTST, Temporal Fusion Transformer, N-HiTS and CatBoost for forecasting electricity load for each hour of the following day. The README also positions these methods against ARIMA and SARIMAX as traditional statistical approaches.

How do I install and run the hourly load forecasting repository?

The README does not document an installation command or a command for running `main.py`. It identifies Python 3.11 and provides pinned dependencies in `requirements.txt`, so those files and the source entry point are the documented starting points.

Does this repository include an API for electricity load forecasts?

No API is documented. Based on the repository layout, the project is organized as a Python analysis with `main.py`, utilities, data and visualization assets rather than a documented forecast service.

Official sources

  1. Issues
  2. KEV0143/Comparative-analysis-of-hourly-load-forecasting-using-PatchTST-TFT-NHiTS-and-CatBoost on GitHub
  3. License: Apache-2.0
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/kev0143-comparative-analysis-of-hourly-load-forecasting-using-patchtst-tft-nhits.svg)](https://hysenlabs.com/projects/kev0143-comparative-analysis-of-hourly-load-forecasting-using-patchtst-tft-nhits)

Was this useful?