Nixtla
Neural 🧠 Forecast
User friendly state-of-the-art neural forecasting models
NeuralForecast offers a large collection of neural forecasting models focusing on their performance, usability, and robustness. The models range from classic networks like RNNs to the latest transformers: MLP, LSTM, GRU, RNN, TCN, TimesNet, BiTCN, DeepAR, NBEATS, NBEATSx, NHITS, TiDE, DeepNPTS, TSMixer, TSMixerx, MLPMultivariate, DLinear, NLinear, TFT, Informer, AutoFormer, FedFormer, PatchTST, iTransformer, StemGNN, and TimeLLM.
Installation
You can install NeuralForecast with:
pip install neuralforecast
or
conda install -c conda-forge neuralforecast
Vist our Installation Guide for further details.
Quick Start
Minimal Example
from neuralforecast import NeuralForecast
from neuralforecast.models import NBEATS
from neuralforecast.utils import AirPassengersDF
nf = NeuralForecast(
models = [NBEATS(input_size=24, h=12, max_steps=100)],
freq = 'ME'
)
nf.fit(df=AirPassengersDF)
nf.predict()
Get Started with this quick guide.
Why?
There is a shared belief in Neural forecasting methods' capacity to improve forecasting pipeline's accuracy and efficiency.
Unfortunately, available implementations and published research are yet to realize neural networks' potential. They are hard to use and continuously fail to improve over statistical methods while being computationally prohibitive. For this reason, we created NeuralForecast, a library favoring proven accurate and efficient models focusing on their usability.
Features
- Fast and accurate implementations of more than 30 state-of-the-art models. See the entire collection here.
- Support for exogenous variables and static covariates.
- Interpretability methods for trend, seasonality and exogenous components.
- Probabilistic Forecasting with adapters for quantile losses and parametric distributions.
- Train and Evaluation Losses with scale-dependent, percentage and scale independent errors, and parametric likelihoods.
- Automatic Model Selection with distributed automatic hyperparameter tuning.
- Familiar sklearn syntax:
.fitand.predict.
Highlights
- Official
NHITSimplementation, published at AAAI 2023. See paper and experiments. - Official
NBEATSximplementation, published at the International Journal of Forecasting. See paper. - Unified with
StatsForecast,MLForecast, andHierarchicalForecastinterfaceNeuralForecast().fit(Y_df).predict(), inputs and outputs. - Built-in integrations with
utilsforecastandcoreforecastfor visualization and data-wrangling efficient methods. - Integrations with
RayandOptunafor automatic hyperparameter optimization. - Predict with little to no history using Transfer learning. Check the experiments here.
Missing something? Please open an issue or write us in
Examples and Guides
The documentation page contains all the examples and tutorials.
📈 Automatic Hyperparameter Optimization: Easy and Scalable Automatic Hyperparameter Optimization with Auto models on Ray or Optuna.
🌡️ Exogenous Regressors: How to incorporate static or temporal exogenous covariates like weather or prices.
🔌 Transformer Models: Learn how to forecast with many state-of-the-art Transformers models.
👑 Hierarchical Forecasting: forecast series with very few non-zero observations.
👩🔬 Add Your Own Model: Learn how to add a new model to the library.
Saving and loading models
From 3.3.0 a saved directory holds safetensors weights and JSON metadata, and is loaded without executing any code it contains. Earlier versions used pickle, which runs arbitrary code from the artifact on load, so the legacy format is now opt-in:
nf.save('./checkpoints/') # writes the new format
nf2 = NeuralForecast.load('./checkpoints/') # no pickle, no code execution
What changed, if you have artifacts or code from an earlier version:
- Older directories need consent or conversion. Pass
allow_pickle=Trueto read one in place, which executes code contained in it, or convert it once withpython -m neuralforecast.migrate ./old_checkpoints/. A directory saved withsave_dataset=Truemust be converted — its dataset has no safe reader. - Remote paths are opt-in.
NeuralForecast.load('s3://bucket/models/', trust_remote=True), because whoever can write that location chooses what runs on the loading machine. - Custom losses, optimizers and schedulers must be registered with
register_loss,register_optimizerorregister_lr_scheduler, in the process that loads as well as the one that saves. TimeLLMcan no longer be saved or loaded. It resolves itsllmargument throughfrom_pretrainedwhile being constructed, so an artifact could direct that fetch. Train and predict with it in the same process.
The save and load guide covers this in full.
Models
See the entire collection here.
Missing a model? Please open an issue or write us in
How to contribute
If you wish to contribute to the project, please refer to our contribution guidelines.
References
This work is highly influenced by the fantastic work of previous contributors and other scholars on the neural forecasting methods presented here. We want to highlight the work of Boris Oreshkin, Slawek Smyl, Bryan Lim, and David Salinas. We refer to Benidis et al. for a comprehensive survey of neural forecasting methods.
🙏 How to cite
If you enjoy or benefit from using these Python implementations, a citation to the repository will be greatly appreciated.
@misc{olivares2022library_neuralforecast,
author={Kin G. Olivares and
Cristian Challú and
Azul Garza and
Max Mergenthaler Canseco and
Artur Dubrawski},
title = {{NeuralForecast}: User friendly state-of-the-art neural forecasting models.},
year={2022},
howpublished={{PyCon} Salt Lake City, Utah, US 2022},
url={https://github.com/Nixtla/neuralforecast}
}
Contributors ✨
Thanks goes to these wonderful people (emoji key):
azul 💻 🚧 |
Cristian Challu 💻 🚧 |
José Morales 💻 🚧 |
mergenthaler 📖 💻 |
Kin 💻 🐛 🔣 |
Greg DeVos 🤔 |
Alejandro 💻 |
stefanialvs 🎨 |
Ikko Ashimine 🐛 |
vglaucus 🐛 |
Pietro Monticone 🐛 |
This project follows the all-contributors specification. Contributions of any kind welcome!
Metadata
Release files for neuralforecast 3.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| neuralforecast-3.3.0.tar.gz | 301.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| neuralforecast-3.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 632.8 kB
Release files / neuralforecast-3.3.0.tar.gz
| Download URL | neuralforecast-3.3.0.tar.gz |
|---|---|
| Size | 301.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73fbb9b8ba194c6f06e64d2f137855c98616af7f2488c7107abb05516a22ebe7
|
|
BLAKE2b-256 checksum How to use checksums |
35ac0c29090dc45e4dac65e04def46e060ee07a20936ed9635cf543313de5b39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency logRelease files / neuralforecast-3.3.0-py3-none-any.whl
| Download URL | neuralforecast-3.3.0-py3-none-any.whl |
|---|---|
| Size | 331.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df16b46ec2e3c3a494047ebe1996c6f4456e176daedc01ab508fbc569f722d45
|
|
BLAKE2b-256 checksum How to use checksums |
1c401c9309b703b889eecf398ea38c4e05909b502209c52d4b37b8d9c16a4b90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency log