--- id: pytorch-forecasting version: "1.8.0" license: unclear license_treatment: permissive maintenance: active --- # pytorch-forecasting — Forecasting timeseries with PyTorch - dataloaders, normalizers, metrics and models License: permissive · Maintenance: active · Downloads: 344.3K/mo ## What it is and what it does PyTorch Forecasting is a high-level library for building and training deep learning time series forecasting models. It abstracts away boilerplate around data handling (variable transformations, missing values, subsampling), model training, and evaluation, while providing several state-of-the-art neural architectures out of the box. The library leverages lightning to handle training on CPUs and GPUs transparently, with automatic logging and visualization. You use it by converting your pandas DataFrame into a TimeSeriesDataSet, choosing a model architecture (Temporal Fusion Transformer, N-BEATS, N-HiTS, DeepAR, or simpler baselines like LSTM), and training via the Lightning Trainer. It includes multi-horizon metrics, interpretation capabilities, and optional hyperparameter tuning. The package targets both practitioners seeking reasonable defaults and researchers needing flexibility to implement custom architectures. Use it for: - Train a Temporal Fusion Transformer on multivariate time series data with both static and time-varying covariates for interpretable multi-step forecasting. - Benchmark multiple architectures (N-BEATS, N-HiTS, DeepAR, LSTM) on your dataset to compare forecasting accuracy without reimplementing each model. - Automatically scale training across multiple GPUs using lightning without modifying model code. - Build a probabilistic forecasting pipeline with DeepAR to generate prediction intervals alongside point forecasts. - Perform hyperparameter tuning with optuna integration to optimize model performance on your specific time series problem. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyTorch Forecasting provides neural network models and utilities for time series forecasting, including architectures like Temporal Fusion Transformers, N-BEATS, and N-HiTS, with training orchestrated through PyTorch Lightning. Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and provides a well-structured abstraction over multiple state-of-the-art forecasting architectures. Install it if you need to train neural forecasting models on time series data and want to avoid reimplementing standard architectures or training boilerplate. The MIT license poses no restrictions. ## Install pip install pytorch-forecasting uv add pytorch-forecasting poetry add pytorch-forecasting ## Installing pytorch-forecasting Before you install: Low friction installation as a pure Python wheel. Depends on torch, lightning, and standard scientific stack (numpy, scipy, pandas, scikit-learn, scikit-base). Last release 51 days ago with active maintenance status. License in practice: MIT license (permissive) allows commercial and private use with minimal restrictions. Quickstart: pip install pytorch-forecasting from pytorch_forecasting import TimeSeriesDataSet, TemporalFusionTransformer import lightning.pytorch as pl training = TimeSeriesDataSet( data, time_idx="time_column", target="target_column", group_ids=["series_id"], max_encoder_length=36, max_prediction_length=6 ) model = TemporalFusionTransformer.from_dataset(training) trainer = pl.Trainer(max_epochs=10) trainer.fit(model, train_dataloaders=training.to_dataloader(train=True)) Requires torch to be installed; on Windows, install torch separately via pip install torch -f https://download.pytorch.org/whl/torch_stable.html before installing pytorch-forecasting. Verify before relying: - Whether the package's GPU/multi-GPU training scales efficiently in production environments - Performance characteristics and memory requirements for large-scale time series datasets - Availability and completeness of hyperparameter tuning integration with optuna ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 344.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags time series forecasting neural networks, pytorch deep learning forecasting, temporal fusion transformer, n-beats forecasting, multivariate time series prediction, lstm gru forecasting, autoregressive forecasting models, time-series-forecasting, deep-learning, pytorch-lightning [View on SkillFed](https://skillfed.io/packages/pytorch-forecasting) · [View on PyPI](https://pypi.org/project/pytorch-forecasting/)