Favicon of NeuralForecast

NeuralForecast

Open-source Python forecasting library with NBEATS, NHITS and transformer models, probabilistic predictions, and automatic tuning. Apache 2.0 licensed.

Screenshot of NeuralForecast website

NeuralForecast is an open-source Python library for data scientists and developers who want to train and compare neural time series forecasting models in their own Python environment. It brings recurrent networks and forecasting-specific architectures under one interface, so comparing models doesn't require working with separate research implementations. The license is Apache 2.0.

The collection includes NBEATS, NHITS, TFT and PatchTST, alongside familiar MLP, LSTM and RNN models. It includes the official implementations of NHITS and NBEATSx. Its shared input and output conventions match StatsForecast, MLForecast and HierarchicalForecast, which helps teams compare neural forecasts with other forecasting methods.

Forecasts can use historical inputs, known future variables and static attributes. For uncertainty estimates, the library supports quantile forecasts and probability distributions. Training and evaluation support percentage errors, scale-dependent and scale-independent errors, plus likelihood-based losses.

Interpretability tools expose trend, seasonality and external-variable components for supported models. IntegratedGradients and ShapleyValueSampling provide feature attribution across the model collection. Automatic hyperparameter tuning works with Ray and Optuna, including parallel or distributed searches evaluated against validation data.

Transfer learning supports prediction with little or no history. Saved models use safetensors weights and JSON metadata, and loading that format doesn't execute code contained in the saved artifact.

Similar to NeuralForecast