Skip to main content

Pypi_Version Code style: black

Please note that the project is still in beta phase. Please report any issues you encounter or suggestions you have. We will do our best to address them quickly. Contributions are also highly welcome!

NeuralProphet

A Neural Network based Time-Series model, inspired by Facebook Prophet and AR-Net, built on PyTorch.

For a visual introduction to NeuralProphet, view the presentation given at the 40th International Symposium on Forecasting.

Documentation

We are working on a documentation page. Contributions welcome!

Use

Install

You can now install neuralprophet directly with pip:

pip install neuralprophet

If you plan to use the package in a Jupyter notebook, we recommended to install the 'live' version:

pip install neuralprophet[live]

This will allow you to enable plot_live_loss in the fit function to get a live plot of train (and validation) loss.

If you would like the most up to date version, you can instead install direclty from github:

git clone <copied link from github>
cd neural_prophet
pip install .

Please note that NeuralProphet requires a Python version >= 3.7 due to the use of @dataclass.

Basic example

from neuralprophet import NeuralProphet

After importing the package, you can use NeuralProphet in your code:

m = NeuralProphet()
metrics = m.fit(df, freq="D")
future = m.make_future_dataframe(df, periods=30)
forecast = m.predict(future)

You can visualize your results with the inbuilt plotting functions:

fig_forecast = m.plot(forecast)
fig_components = m.plot_components(forecast)
fig_model = m.plot_parameters()

Model Features

  • Autocorrelation modelling through AR-Net
  • Piecewise linear trend
  • Fourier term Seasonality at different periods such as yearly, daily, weekly, hourly.
  • Lagged regressors
  • Future regressors
  • Holidays & special events
  • Sparsity of coefficients through regularization
  • Plotting for forecast components, model coefficients as well as final forecasts

Contribute

Dev Install

Before starting it's a good idea to first create and activate a new virtual environment:

python3 -m venv <path-to-new-env>
source <path-to-new-env>/bin/activate

Now you can install neuralprophet:

git clone <copied link from github>
cd neural_prophet
pip install -e .[dev]
neuralprophet_dev_setup

Notes:

  • The last command runs the dev-setup script which installs appropriate git hooks for Black (pre-commit) and Unittests (pre-push).
  • Including the optional -e flag will install neuralprophet in "editable" mode, meaning that instead of copying the files into your virtual environment, a symlink will be created to the files where they are.

Style

We deploy Black, the uncompromising code formatter, so there is no need to worry about style. Beyond that, where reasonable, for example for docstrings, we follow the Google Python Style Guide

As for Git practices, please follow the steps described at Swiss Cheese for how to git-rebase-squash when working on a forked repo.

Changelogs

Coming up soon

For details, please view the Development Timeline.

The next versions of NeuralProphet are expected to cover a set of new exciting features:

  • Robustify training for different datasets
  • Logistic growth for trend component.
  • Uncertainty estimation of individual forecast components as well as the final forecasts.
  • Support for panel data by building global forecasting models.
  • Incorporate time series featurization for improved forecast accuracy.

0.2.8 (next)

  • soft-start regularization
  • confidence interval for forecast (as quantiles via pinball loss)

0.2.7 (current)

  • example notebooks: Sub-daily data, Autoregresseion
  • bugfixes: lambda_delay, train_speed

0.2.6

  • Auto-set batch_size and epochs
  • add train_speed setting
  • add set_random_seed util
  • continued removal of AttrDict uses
  • bugfix to index issue in make_future_dataframe

0.2.5

  • documentation pages added
  • 1cycle policy
  • learning rate range test
  • tutorial notebooks: trend, events
  • fixes to plotting, changepoints

Authors

The project efford is led by Oskar Triebe (Stanford University), advised by Nikolay Laptev (Facebook, Inc) and Ram Rajagopal (Stanford University) and has been partially funded by Total S.A. The project has been developed in close collaboration with Hansika Hewamalage, who is advised by Christoph Bergmeir (Monash University).

Contributors

This is the list of NeuralProphet's significant contributors. This does not necessarily list everyone who has contributed code. To see the full list of contributors, see the revision history in source control.

  • Oskar Triebe
  • Hansika Hewamalage
  • Nikolay Laptev
  • Riley Dehaan
  • Gonzague Henri
  • Ram Rajagopal
  • Christoph Bergmeir
  • Italo Lima
  • Caner Komurlu
  • Rodrigo Riveraca

If you are interested in joining the project, please feel free to reach out to me (Oskar) - you can find my email on the AR-Net Paper.

Release files for neuralprophet 0.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neuralprophet 0.2.7
File Size Uploaded
neuralprophet-0.2.7.tar.gz 53.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for neuralprophet 0.2.7
File Interpreter ABI Platform
neuralprophet-0.2.7-py3-none-any.whl Python 3 none any Details

Total release size: 109.2 kB

Release files / neuralprophet-0.2.7.tar.gz

Download URL neuralprophet-0.2.7.tar.gz
Size 53.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a217bdd69e4bc960f5407f35ca33733a6416775afebe60c65a4b98b3daea2486
BLAKE2b-256 checksum
How to use checksums
6dce560e3843e7e8536db4776e59ccced806f47ab32a08a76ec9aab97583519a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

Release files / neuralprophet-0.2.7-py3-none-any.whl

Download URL neuralprophet-0.2.7-py3-none-any.whl
Size 56.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa5ba563374d42e2df37f14fe2fc2eb27136a872ccbd68f89072dc322e7a712e
BLAKE2b-256 checksum
How to use checksums
20521e00f0713b9e0e040f38834e94b6f3c3dd55b7f291e77664f27eb670abb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page