prophet

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.

https://github.com/facebook/prophet

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    6 of 186 committers (3.2%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary

Keywords

forecasting python r

Keywords from Contributors

distributed closember alignment flexible tensors autograd pipeline-testing gbdt gbm gbrt
Last synced: 6 months ago · JSON representation

Repository

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.

Basic Info
Statistics
  • Stars: 19,571
  • Watchers: 455
  • Forks: 4,622
  • Open Issues: 450
  • Releases: 18
Topics
forecasting python r
Created over 9 years ago · Last pushed 7 months ago
Metadata Files
Readme Contributing License Code of conduct

README.md

Prophet: Automatic Forecasting Procedure

Build

PyPI Version PyPI Downloads Monthly PyPI Downloads All

CRAN Version CRAN Downloads Monthly CRAN Downloads All

Conda_Version


2023 Update: We discuss our plans for the future of Prophet in this blog post: facebook/prophet in 2023 and beyond


Prophet is a procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. It works best with time series that have strong seasonal effects and several seasons of historical data. Prophet is robust to missing data and shifts in the trend, and typically handles outliers well.

Prophet is open source software released by Facebook's Core Data Science team. It is available for download on CRAN and PyPI.

Important links

  • Homepage: https://facebook.github.io/prophet/
  • HTML documentation: https://facebook.github.io/prophet/docs/quick_start.html
  • Issue tracker: https://github.com/facebook/prophet/issues
  • Source code repository: https://github.com/facebook/prophet
  • Contributing: https://facebook.github.io/prophet/docs/contributing.html
  • Prophet R package: https://cran.r-project.org/package=prophet
  • Prophet Python package: https://pypi.python.org/pypi/prophet/
  • Release blogpost: https://research.facebook.com/blog/2017/2/prophet-forecasting-at-scale/
  • Prophet paper: Sean J. Taylor, Benjamin Letham (2018) Forecasting at scale. The American Statistician 72(1):37-45 (https://peerj.com/preprints/3190.pdf).

Installation in R - CRAN

⚠️ The CRAN version of prophet is fairly outdated. To get the latest bug fixes and updated country holiday data, we suggest installing the latest release.

Prophet is a CRAN package so you can use install.packages.

r install.packages('prophet')

After installation, you can get started!

Installation in R - Latest release

r install.packages('remotes') remotes::install_github('facebook/prophet@*release', subdir = 'R')

Experimental backend - cmdstanr

You can also choose an experimental alternative stan backend called cmdstanr. Once you've installed prophet, follow these instructions to use cmdstanr instead of rstan as the backend:

```r

R

We recommend running this in a fresh R session or restarting your current session

install.packages(c("cmdstanr", "posterior"), repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

If you haven't installed cmdstan before, run:

cmdstanr::install_cmdstan()

Otherwise, you can point cmdstanr to your cmdstan path:

cmdstanr::setcmdstanpath(path = )

Set the RSTANBACKEND environment variable

Sys.setenv(RSTANBACKEND = "CMDSTANR") ```

Windows

On Windows, R requires a compiler so you'll need to follow the instructions provided by rstan. The key step is installing Rtools before attempting to install the package.

If you have custom Stan compiler settings, install from source rather than the CRAN binary.

Installation in Python - PyPI release

Prophet is on PyPI, so you can use pip to install it.

bash python -m pip install prophet

  • From v0.6 onwards, Python 2 is no longer supported.
  • As of v1.0, the package name on PyPI is "prophet"; prior to v1.0 it was "fbprophet".
  • As of v1.1, the minimum supported Python version is 3.7.

After installation, you can get started!

Anaconda

Prophet can also be installed through conda-forge.

bash conda install -c conda-forge prophet

Installation in Python - Development version

To get the latest code changes as they are merged, you can clone this repo and build from source manually. This is not guaranteed to be stable.

bash git clone https://github.com/facebook/prophet.git cd prophet/python python -m pip install -e .

By default, Prophet will use a fixed version of cmdstan (downloading and installing it if necessary) to compile the model executables. If this is undesired and you would like to use your own existing cmdstan installation, you can set the environment variable PROPHET_REPACKAGE_CMDSTAN to False:

bash export PROPHET_REPACKAGE_CMDSTAN=False; python -m pip install -e .

Linux

Make sure compilers (gcc, g++, build-essential) and Python development tools (python-dev, python3-dev) are installed. In Red Hat systems, install the packages gcc64 and gcc64-c++. If you are using a VM, be aware that you will need at least 4GB of memory to install prophet, and at least 2GB of memory to use prophet.

Windows

Using cmdstanpy with Windows requires a Unix-compatible C compiler such as mingw-gcc. If cmdstanpy is installed first, one can be installed via the cmdstanpy.install_cxx_toolchain command.

Changelog

Version 1.1.6 (2024.09.29)

Python

  • Bug fixes: include predictions for dates with missing y the history, zero division error in cross validation metrics.
  • Changed NDArray[np.float_] to NDArray[np.float64] to be compatible with numpy 2.0

R

  • Updated holidays data based on holidays version 0.57.

Version 1.1.5 (2023.10.10)

Python

  • Upgraded cmdstan version to 2.33.1, enabling Apple M2 support.
  • Added pre-built wheels for macOS arm64 architecture (M1, M2 chips)
  • Added argument scaling to the Prophet() instantiation. Allows minmax scaling on y instead of absmax scaling (dividing by the maximum value). scaling='absmax' by default, preserving the behaviour of previous versions.
  • Added argument holidays_mode to the Prophet() instantiation. Allows holidays regressors to have a different mode than seasonality regressors. holidays_mode takes the same value as seasonality_mode if not specified, preserving the behaviour of previous versions.
  • Added two methods to the Prophet object: preprocess() and calculate_initial_params(). These do not need to be called and will not change the model fitting process. Their purpose is to provide clarity on the pre-processing steps taken (y scaling, creating fourier series, regressor scaling, setting changepoints, etc.) before the data is passed to the stan model.
  • Added argument extra_output_columns to cross_validation(). The user can specify additional columns from predict() to include in the final output alongside ds and yhat, for example extra_output_columns=['trend'].
  • prophet's custom hdays module was deprecated last version and is now removed.

R

  • Updated holidays data based on holidays version 0.34.

Version 1.1.4 (2023.05.30)

Python

  • We now rely solely on holidays package for country holidays.
  • Upgraded cmdstan version to 2.31.0, enabling Apple M1 support.
  • Fixed bug with Windows installation caused by long paths.

R

  • Updated holidays data based on holidays version 0.25.

Version 1.1.2 (2023.01.20)

Python

  • Sped up .predict() by up to 10x by removing intermediate DataFrame creations.
  • Sped up fourier series generation, leading to at least 1.5x speed improvement for train() and predict() pipelines.
  • Fixed bug in how warm start values were being read.
  • Wheels are now version-agnostic.

R

  • Fixed a bug in construct_holiday_dataframe()
  • Updated holidays data based on holidays version 0.18.

Version 1.1.1 (2022.09.08)

  • (Python) Improved runtime (3-7x) of uncertainty predictions via vectorization.
  • Bugfixes relating to Python package versions and R holiday objects.

Version 1.1 (2022.06.25)

  • Replaced pystan2 dependency with cmdstan + cmdstanpy.
  • Pre-packaged model binaries for Python package, uploaded binary distributions to PyPI.
  • Improvements in the stan model code, cross-validation metric calculations, holidays.

Version 1.0 (2021.03.28)

  • Python package name changed from fbprophet to prophet
  • Fixed R Windows build issues to get latest version back on CRAN
  • Improvements in serialization, holidays, and R timezone handling
  • Plotting improvements

Version 0.7 (2020.09.05)

  • Built-in json serialization
  • Added "flat" growth option
  • Bugfixes related to holidays and pandas
  • Plotting improvements
  • Improvements in cross validation, such as parallelization and directly specifying cutoffs

Version 0.6 (2020.03.03)

  • Fix bugs related to upstream changes in holidays and pandas packages.
  • Compile model during first use, not during install (to comply with CRAN policy)
  • cmdstanpy backend now available in Python
  • Python 2 no longer supported

Version 0.5 (2019.05.14)

  • Conditional seasonalities
  • Improved cross validation estimates
  • Plotly plot in Python
  • Bugfixes

Version 0.4 (2018.12.18)

  • Added holidays functionality
  • Bugfixes

Version 0.3 (2018.06.01)

  • Multiplicative seasonality
  • Cross validation error metrics and visualizations
  • Parameter to set range of potential changepoints
  • Unified Stan model for both trend types
  • Improved future trend uncertainty for sub-daily data
  • Bugfixes

Version 0.2.1 (2017.11.08)

  • Bugfixes

Version 0.2 (2017.09.02)

  • Forecasting with sub-daily data
  • Daily seasonality, and custom seasonalities
  • Extra regressors
  • Access to posterior predictive samples
  • Cross-validation function
  • Saturating minimums
  • Bugfixes

Version 0.1.1 (2017.04.17)

  • Bugfixes
  • New options for detecting yearly and weekly seasonality (now the default)

Version 0.1 (2017.02.23)

  • Initial release

License

Prophet is licensed under the MIT license.

Owner

  • Name: Meta
  • Login: facebook
  • Kind: organization
  • Location: Menlo Park, California

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

GitHub Events

Total
  • Create event: 9
  • Release event: 1
  • Issues event: 38
  • Watch event: 1,101
  • Delete event: 4
  • Issue comment event: 84
  • Push event: 18
  • Pull request event: 25
  • Pull request review event: 14
  • Pull request review comment event: 4
  • Fork event: 134
Last Year
  • Create event: 9
  • Release event: 1
  • Issues event: 38
  • Watch event: 1,101
  • Delete event: 4
  • Issue comment event: 84
  • Push event: 18
  • Pull request event: 25
  • Pull request review event: 14
  • Pull request review comment event: 4
  • Fork event: 134

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 776
  • Total Committers: 186
  • Avg Commits per committer: 4.172
  • Development Distribution Score (DDS): 0.543
Past Year
  • Commits: 26
  • Committers: 11
  • Avg Commits per committer: 2.364
  • Development Distribution Score (DDS): 0.538
Top Committers
Name Email Commits
Ben Letham b****m@g****m 355
Cuong Duong c****2@g****m 49
Sean J. Taylor s****t@f****m 33
Cuong Duong c****g@c****m 26
Ryan Nazareth r****s@g****m 23
dependabot[bot] 4****] 19
Sean Taylor s****t@l****m 12
Ben Letham b****m@b****m 7
baogorek b****k@g****m 6
Brian Ward b****d@f****g 5
Sam Snarr 3****s 5
Maxim Grishin i****e@g****m 5
Jose Angel Sanchez Castillejos j****s@g****m 5
Chanran Kim b****r@n****m 5
Alexander Gawrilow a****w@n****e 4
Ray Bell r****0@g****m 4
Olof Höjvall o****l@g****m 4
Isaac Laughlin i****n@g****m 4
dmitryvinn d****n@g****m 4
Arkadii Yakovets a****k@c****d 3
Yasir Ekinci y****i@g****m 3
Mert Sarikaya 4****s 3
Rolando Espinoza r****4@g****m 3
Nagi Teramo t****i@g****m 3
Greg Rafferty g****t@g****m 3
Christopher Suchanek c****k@g****m 3
MT w****y@g****m 2
Marco Edward Gorelli m****i@p****m 2
hoxo-m h****e@g****m 2
Louis Potok l****k@g****m 2
and 156 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 350
  • Total pull requests: 104
  • Average time to close issues: 8 months
  • Average time to close pull requests: 2 months
  • Total issue authors: 326
  • Total pull request authors: 48
  • Average comments per issue: 3.74
  • Average comments per pull request: 2.05
  • Merged pull requests: 61
  • Bot issues: 0
  • Bot pull requests: 17
Past Year
  • Issues: 46
  • Pull requests: 29
  • Average time to close issues: 1 day
  • Average time to close pull requests: 2 months
  • Issue authors: 43
  • Pull request authors: 12
  • Average comments per issue: 0.24
  • Average comments per pull request: 1.17
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 5
Top Authors
Issue Authors
  • tcuongd (6)
  • carlosg-m (3)
  • KathyGCY (3)
  • gboulmier (2)
  • bletham (2)
  • ghost (2)
  • Tempo0o (2)
  • vladchestTELUS (2)
  • torsten156 (2)
  • paulojunqueira (2)
  • andrewbryk (2)
  • wdongdongde (2)
  • Sandy4321 (2)
  • nipnipj (2)
  • siyer37 (2)
Pull Request Authors
  • dependabot[bot] (22)
  • tcuongd (16)
  • marwanmusa (4)
  • arkid15r (4)
  • MarcoGorelli (3)
  • AlexandroLuis (3)
  • Iandenh (2)
  • ShivMunagala (2)
  • josephkohler (2)
  • akhil0404-tech (2)
  • lihangalex (2)
  • donggu-kang (2)
  • qododavid (2)
  • hub-bla (2)
  • giocomai (2)
Top Labels
Issue Labels
py (47) install (34) question (20) enhancement (15) bug (14) windows (12) good first issue (5) mac (3) help wanted (3) unix (3) ready (2) invalid (1) R (1)
Pull Request Labels
CLA Signed (103) dependencies (22) ruby (8) github_actions (1)

Packages

  • Total packages: 9
  • Total downloads:
    • pypi 6,610,079 last-month
    • cran 12,200 last-month
  • Total docker downloads: 5,487,352
  • Total dependent packages: 118
    (may contain duplicates)
  • Total dependent repositories: 2,287
    (may contain duplicates)
  • Total versions: 71
  • Total maintainers: 5
pypi.org: prophet

Automatic Forecasting Procedure

  • Versions: 11
  • Dependent Packages: 81
  • Dependent Repositories: 1,298
  • Downloads: 6,492,831 Last month
  • Docker Downloads: 5,459,804
Rankings
Forks count: 0.1%
Stargazers count: 0.1%
Downloads: 0.2%
Dependent packages count: 0.2%
Average: 0.3%
Dependent repos count: 0.3%
Docker downloads count: 0.6%
Maintainers (3)
Last synced: 6 months ago
pypi.org: fbprophet

Automatic Forecasting Procedure

  • Versions: 14
  • Dependent Packages: 18
  • Dependent Repositories: 931
  • Downloads: 117,237 Last month
  • Docker Downloads: 951
Rankings
Forks count: 0.1%
Stargazers count: 0.1%
Downloads: 0.4%
Dependent repos count: 0.4%
Average: 0.5%
Dependent packages count: 0.7%
Docker downloads count: 1.6%
Maintainers (2)
Last synced: 6 months ago
proxy.golang.org: github.com/facebook/prophet
  • Versions: 12
  • Dependent Packages: 0
  • Dependent Repositories: 1
Rankings
Forks count: 0.1%
Stargazers count: 0.5%
Average: 3.4%
Dependent repos count: 4.8%
Dependent packages count: 8.4%
Last synced: 6 months ago
conda-forge.org: prophet

Implements a procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. It works best with time series that have strong seasonal effects and several seasons of historical data. Prophet is robust to missing data and shifts in the trend, and typically handles outliers well.

  • Versions: 3
  • Dependent Packages: 7
  • Dependent Repositories: 11
Rankings
Forks count: 1.6%
Stargazers count: 2.1%
Average: 5.6%
Dependent packages count: 8.0%
Dependent repos count: 10.6%
Last synced: 6 months ago
cran.r-project.org: prophet

Automatic Forecasting Procedure

  • Versions: 11
  • Dependent Packages: 7
  • Dependent Repositories: 21
  • Downloads: 12,200 Last month
  • Docker Downloads: 26,597
Rankings
Stargazers count: 0.0%
Forks count: 0.0%
Downloads: 3.4%
Dependent repos count: 6.1%
Average: 6.4%
Dependent packages count: 6.4%
Docker downloads count: 22.2%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: fbprophet

Implements a procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. It works best with time series that have strong seasonal effects and several seasons of historical data. Prophet is robust to missing data and shifts in the trend, and typically handles outliers well.

  • Versions: 9
  • Dependent Packages: 3
  • Dependent Repositories: 13
Rankings
Forks count: 1.6%
Stargazers count: 2.1%
Average: 7.2%
Dependent repos count: 9.7%
Dependent packages count: 15.6%
Last synced: 6 months ago
conda-forge.org: r-prophet
  • Versions: 5
  • Dependent Packages: 2
  • Dependent Repositories: 0
Rankings
Forks count: 1.5%
Stargazers count: 2.0%
Average: 14.2%
Dependent packages count: 19.5%
Dependent repos count: 34.0%
Last synced: 6 months ago
pypi.org: prophet-freddy

Automatic Forecasting Procedure

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 11 Last month
Rankings
Forks count: 0.1%
Stargazers count: 0.1%
Dependent packages count: 7.3%
Average: 16.1%
Dependent repos count: 22.1%
Downloads: 50.7%
Maintainers (1)
Last synced: 6 months ago
anaconda.org: prophet

Implements a procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. It works best with time series that have strong seasonal effects and several seasons of historical data. Prophet is robust to missing data and shifts in the trend, and typically handles outliers well.

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 11
Rankings
Forks count: 4.8%
Stargazers count: 6.0%
Average: 22.3%
Dependent repos count: 37.3%
Dependent packages count: 41.0%
Last synced: 6 months ago

Dependencies

.github/workflows/build-and-test.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/wheel.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/upload-artifact v3 composite
  • docker/setup-qemu-action v2 composite
  • pypa/cibuildwheel v2.11.4 composite
  • pypa/gh-action-pypi-publish v1.4.2 composite
R/DESCRIPTION cran
  • R >= 3.4.0 depends
  • Rcpp >= 0.12.0 depends
  • rlang >= 0.3.0.1 depends
  • RcppParallel >= 5.0.1 imports
  • StanHeaders * imports
  • dplyr >= 0.7.7 imports
  • dygraphs >= 1.1.1.4 imports
  • extraDistr * imports
  • ggplot2 * imports
  • grid * imports
  • lubridate * imports
  • methods * imports
  • rstan >= 2.18.1 imports
  • rstantools >= 2.0.0 imports
  • scales * imports
  • stats * imports
  • tidyr >= 0.6.1 imports
  • xts * imports
  • cmdstanr * suggests
  • knitr * suggests
  • posterior * suggests
  • readr * suggests
  • rmarkdown * suggests
  • testthat * suggests
Dockerfile docker
  • python 3.7-stretch build
docker-compose.yml docker
  • facebook/prophet latest
python/pyproject.toml pypi
  • cmdstanpy >=1.0.4
  • holidays >=0.25
  • importlib_resources *
  • matplotlib >=2.0.0
  • numpy >=1.15.4
  • pandas >=1.0.4
  • tqdm >=4.36.1
python/setup.py pypi
python_shim/requirements.txt pypi
  • prophet *
python_shim/setup.py pypi
docs/Gemfile rubygems
  • github-pages >= 0 development
docs/Gemfile.lock rubygems
  • activesupport 6.0.6.1
  • addressable 2.8.0
  • bundler 2.1.4
  • coffee-script 2.4.1
  • coffee-script-source 1.11.1
  • colorator 1.1.0
  • commonmarker 0.17.13
  • concurrent-ruby 1.2.0
  • dnsruby 1.61.5
  • em-websocket 0.5.2
  • ethon 0.12.0
  • eventmachine 1.2.7
  • execjs 2.7.0
  • faraday 1.3.0
  • faraday-net_http 1.0.0
  • ffi 1.14.2
  • forwardable-extended 2.6.0
  • gemoji 3.0.1
  • github-pages 209
  • github-pages-health-check 1.16.1
  • html-pipeline 2.14.0
  • http_parser.rb 0.6.0
  • i18n 0.9.5
  • jekyll 3.9.0
  • jekyll-avatar 0.7.0
  • jekyll-coffeescript 1.1.1
  • jekyll-commonmark 1.3.1
  • jekyll-commonmark-ghpages 0.1.6
  • jekyll-default-layout 0.1.4
  • jekyll-feed 0.15.1
  • jekyll-gist 1.5.0
  • jekyll-github-metadata 2.13.0
  • jekyll-mentions 1.6.0
  • jekyll-optional-front-matter 0.3.2
  • jekyll-paginate 1.1.0
  • jekyll-readme-index 0.3.0
  • jekyll-redirect-from 0.16.0
  • jekyll-relative-links 0.6.1
  • jekyll-remote-theme 0.4.2
  • jekyll-sass-converter 1.5.2
  • jekyll-seo-tag 2.6.1
  • jekyll-sitemap 1.4.0
  • jekyll-swiss 1.0.0
  • jekyll-theme-architect 0.1.1
  • jekyll-theme-cayman 0.1.1
  • jekyll-theme-dinky 0.1.1
  • jekyll-theme-hacker 0.1.2
  • jekyll-theme-leap-day 0.1.1
  • jekyll-theme-merlot 0.1.1
  • jekyll-theme-midnight 0.1.1
  • jekyll-theme-minimal 0.1.1
  • jekyll-theme-modernist 0.1.1
  • jekyll-theme-primer 0.5.4
  • jekyll-theme-slate 0.1.1
  • jekyll-theme-tactile 0.1.1
  • jekyll-theme-time-machine 0.1.1
  • jekyll-titles-from-headings 0.5.3
  • jekyll-watch 2.2.1
  • jemoji 0.12.0
  • kramdown 2.3.0
  • kramdown-parser-gfm 1.1.0
  • liquid 4.0.3
  • listen 3.4.0
  • mercenary 0.3.6
  • mini_portile2 2.8.1
  • minima 2.5.1
  • minitest 5.17.0
  • multipart-post 2.1.1
  • nokogiri 1.13.10
  • octokit 4.20.0
  • pathutil 0.16.2
  • public_suffix 3.1.1
  • racc 1.6.2
  • rb-fsevent 0.10.4
  • rb-inotify 0.10.1
  • rexml 3.2.5
  • rouge 3.23.0
  • ruby-enum 0.8.0
  • ruby2_keywords 0.0.2
  • rubyzip 2.3.0
  • safe_yaml 1.0.5
  • sass 3.7.4
  • sass-listen 4.0.0
  • sawyer 0.8.2
  • simpleidn 0.1.1
  • terminal-table 1.8.0
  • thread_safe 0.3.6
  • typhoeus 1.4.0
  • tzinfo 1.2.11
  • unf 0.1.4
  • unf_ext 0.0.7.7
  • unicode-display_width 1.7.0
  • zeitwerk 2.6.6