Giter Site home page Giter Site logo

ourownstory / neural_prophet Goto Github PK

View Code? Open in Web Editor NEW
3.7K 56.0 466.0 216.94 MB

NeuralProphet: A simple forecasting package

Home Page: https://neuralprophet.com

License: MIT License

Python 99.89% Shell 0.11%
forecasting time-series machine-learning fbprophet prophet forecast artificial-intelligence prediction trend seasonality

neural_prophet's Introduction

GitHub release (latest SemVer) Pypi_Version Python Version Code style: black License Tests codecov Slack Downloads

NP-logo-wide_cut

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 very welcome!

NeuralProphet: human-centered forecasting

NeuralProphet is an easy to learn framework for interpretable time series forecasting. NeuralProphet is built on PyTorch and combines Neural Networks and traditional time-series algorithms, inspired by Facebook Prophet and AR-Net.

  • With a few lines of code, you can define, customize, visualize, and evaluate your own forecasting models.
  • It is designed for iterative human-in-the-loop model building. That means that you can build a first model quickly, interpret the results, improve, repeat. Due to the focus on interpretability and customization-ability, NeuralProphet may not be the most accurate model out-of-the-box; so, don't hesitate to adjust and iterate until you like your results.
  • NeuralProphet is best suited for time series data that is of higher-frequency (sub-daily) and longer duration (at least two full periods/years).

Documentation

The documentation page may not be entirely up to date. Docstrings should be reliable, please refer to those when in doubt. We are working on an improved documentation. We appreciate any help to improve and update the docs.

For a visual introduction to NeuralProphet, view this presentation.

Contribute

We compiled a Contributing to NeuralProphet page with practical instructions and further resources to help you become part of the family.

Community

Discussion and Help

If you have any questions or suggestion, you can participate in our community right here on Github

Slack Chat

We also have an active Slack community. Come and join the conversation!

Tutorials

Open All Collab

There are several example notebooks to help you get started.

You can find the datasets used in the tutorials, including data preprocessing examples, in our neuralprophet-data repository.

Please refer to our documentation page for more resources.

Minimal example

from neuralprophet import NeuralProphet

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

m = NeuralProphet()
metrics = m.fit(df)
forecast = m.predict(df)

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()

If you want to forecast into the unknown future, extend the dataframe before predicting:

m = NeuralProphet().fit(df, freq="D")
df_future = m.make_future_dataframe(df, periods=30)
forecast = m.predict(df_future)
fig_forecast = m.plot(forecast)

Install

You can now install neuralprophet directly with pip:

pip install neuralprophet

Install options

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 directly from github:

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

Note for Windows users: Please use WSL2.

Features

Model components

  • Autoregression: Autocorrelation modelling - linear or NN (AR-Net).
  • Trend: Piecewise linear trend with optional automatic changepoint detection.
  • Seasonality: Fourier terms at different periods such as yearly, daily, weekly, hourly.
  • Lagged regressors: Lagged observations (e.g temperature sensor) - linear or NN.
  • Future regressors: In advance known features (e.g. temperature forecast) - linear or NN.
  • Events: Country holidays & recurring custom events.
  • Global Modeling: Components can be local, global or 'glocal' (global + regularized local)

Framework features

  • Multiple time series: Fit a global/glocal model with (partially) shared model parameters.
  • Uncertainty: Estimate values of specific quantiles - Quantile Regression.
  • Regularize modelling components.
  • Plotting of forecast components, model coefficients and more.
  • Time series crossvalidation utility.
  • Model checkpointing and validation.

Coming soon™️

  • Cross-relation of lagged regressors.
  • Static metadata regression for multiple series
  • Logistic growth for trend component.

For a list of past changes, please refer to the releases page.

Cite

Please cite NeuralProphet in your publications if it helps your research:

@misc{triebe2021neuralprophet,
      title={NeuralProphet: Explainable Forecasting at Scale}, 
      author={Oskar Triebe and Hansika Hewamalage and Polina Pilyugina and Nikolay Laptev and Christoph Bergmeir and Ram Rajagopal},
      year={2021},
      eprint={2111.15397},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}

Many Thanks To Our Contributors:

About

NeuralProphet is an open-source community project, supported by awesome people like you. If you are interested in joining the project, please feel free to reach out to me (Oskar) - you can find my email on the NeuralProphet Paper.

neural_prophet's People

Contributors

alfonsogarciadecorral avatar bhausleitner avatar christymctse avatar dependabot[bot] avatar eltociear avatar epistoteles avatar fubonchu avatar georgesen avatar gonzaguehenri avatar hansikaph avatar hxyue1 avatar jsarsfield avatar judussoari avatar kaleming avatar kapoor1992 avatar karl-richter avatar kevin-chen0 avatar leoniefreisinger avatar leoniewgnr avatar mateusgheorghe avatar nlaptev avatar noxan avatar ourownstory avatar riley16 avatar rorcde avatar saumyabhushan avatar sharkfin-top avatar simonwittner avatar thekoc avatar ziqin8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neural_prophet's Issues

Non-date data: Support equidistant data without datestamps

Currently, the best approach is to simply map it to some random series of datestamps.
A helper function to do this might be useful, as dealing with datetimes can be messy.

However, proper support for such data should be implemented eventually. It is not complex, but somewhat complicated as there are many touch points with datetime stamps.
This will entail:

  • data checks and missing data imputation
  • trend and seasonality computation
  • plotting support

feature: model saving and loading functions using torch

inspiration
https://github.com/cs230-stanford/cs230-code-examples/tree/master/pytorch

Can simply save/load NeuralProphet.model
https://pytorch.org/tutorials/beginner/saving_loading_models.html

Issue:
must also store hyperparameter settings and any settings for events, regressors, etc.
may need a change in how configurations are stored/initialized

How:
We should implement this using torch.save() and torch.load()
with the recommended way of storing pytorch models
https://stackoverflow.com/questions/42703500/best-way-to-save-a-trained-model-in-pytorch

m.plot_components plots seasonality for all available history

m.plot_components plots the seasonality for all of the available history.

This can make some plots - like the weekly seasonality - not so easy to understand. See attachment.

According to documentation, crop_last_n, which would help alleviate this issue, should be ignored for seasonality.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.