mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-21 09:15:36 +00:00
Merge branch 'master' of github.com:facebook/prophet
This commit is contained in:
commit
a8abc0327d
12 changed files with 76 additions and 98 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# Prophet: Automatic Forecasting Procedure
|
# Prophet: Automatic Forecasting Procedure
|
||||||
|
|
||||||
[](https://travis-ci.org/facebook/prophet)
|
[](https://travis-ci.org/facebook/prophet)
|
||||||
|
|
||||||
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 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.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ include stan/unix/*.stan
|
||||||
include stan/win/*.stan
|
include stan/win/*.stan
|
||||||
include LICENSE
|
include LICENSE
|
||||||
include requirements.txt
|
include requirements.txt
|
||||||
include pyproject.toml
|
|
||||||
|
|
||||||
# Ensure in-place built models do not get included in the source dist.
|
# Ensure in-place built models do not get included in the source dist.
|
||||||
prune fbprophet/stan_model
|
prune fbprophet/stan_model
|
||||||
|
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
Prophet: Automatic Forecasting Procedure
|
|
||||||
========================================
|
|
||||||
|
|
||||||
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 <https://code.facebook.com/projects/>`_ released by Facebook's `Core Data Science team <https://research.fb.com/category/data-science/>`_.
|
|
||||||
|
|
||||||
Full documentation and examples available at the homepage: https://facebook.github.io/prophet/
|
|
||||||
|
|
||||||
Important links
|
|
||||||
---------------
|
|
||||||
|
|
||||||
- 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
|
|
||||||
- Implementation of Prophet in R: https://cran.r-project.org/package=prophet
|
|
||||||
|
|
||||||
|
|
||||||
Other forecasting packages
|
|
||||||
--------------------------
|
|
||||||
|
|
||||||
- Rob Hyndman's `forecast package <http://robjhyndman.com/software/forecast/>`_
|
|
||||||
- `Statsmodels <http://statsmodels.sourceforge.net/>`_
|
|
||||||
|
|
||||||
|
|
||||||
Installation
|
|
||||||
------------
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
$ pip install fbprophet
|
|
||||||
|
|
||||||
|
|
||||||
Note: Installation requires PyStan, which has its `own installation instructions <http://pystan.readthedocs.io/en/latest/installation_beginner.html>`_. On Windows, PyStan requires a compiler so you'll need to `follow the instructions<http://pystan.readthedocs.io/en/latest/windows.html>`_. The key step is installing a recent `C++ compiler <http://landinghub.visualstudio.com/visual-cpp-build-tools>`_.
|
|
||||||
|
|
||||||
Example usage
|
|
||||||
-------------
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
>>> from fbprophet import Prophet
|
|
||||||
>>> m = Prophet()
|
|
||||||
>>> m.fit(df) # df is a pandas.DataFrame with 'y' and 'ds' columns
|
|
||||||
>>> future = m.make_future_dataframe(periods=365)
|
|
||||||
>>> m.predict(future)
|
|
||||||
|
|
||||||
38
python/README.md
Normal file
38
python/README.md
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
# Prophet: Automatic Forecasting Procedure
|
||||||
|
|
||||||
|
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](https://code.facebook.com/projects/>) released by [Facebook's Core Data Science team ](https://research.fb.com/category/data-science/).
|
||||||
|
|
||||||
|
Full documentation and examples available at the homepage: https://facebook.github.io/prophet/
|
||||||
|
|
||||||
|
## Important links
|
||||||
|
|
||||||
|
- 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
|
||||||
|
- Implementation of Prophet in R: https://cran.r-project.org/package=prophet
|
||||||
|
|
||||||
|
## Other forecasting packages
|
||||||
|
|
||||||
|
- Rob Hyndman's [forecast package](http://robjhyndman.com/software/forecast/)
|
||||||
|
- [Statsmodels](http://statsmodels.sourceforge.net/)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pip install fbprophet
|
||||||
|
```
|
||||||
|
Note: Installation requires PyStan, which has its [own installation instructions](http://pystan.readthedocs.io/en/latest/installation_beginner.html).
|
||||||
|
On Windows, PyStan requires a compiler so you'll need to [follow the instructions](http://pystan.readthedocs.io/en/latest/windows.html).
|
||||||
|
The key step is installing a recent [C++ compiler](http://landinghub.visualstudio.com/visual-cpp-build-tools)
|
||||||
|
|
||||||
|
### Example usage
|
||||||
|
|
||||||
|
```python
|
||||||
|
>>> from fbprophet import Prophet
|
||||||
|
>>> m = Prophet()
|
||||||
|
>>> m.fit(df) # df is a pandas.DataFrame with 'y' and 'ds' columns
|
||||||
|
>>> future = m.make_future_dataframe(periods=365)
|
||||||
|
>>> m.predict(future)
|
||||||
|
```
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (c) 2017-present, Facebook, Inc.
|
# Copyright (c) 2017-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
|
|
@ -5,14 +6,11 @@
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree. An additional grant
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
# of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, division, print_function
|
||||||
from __future__ import division
|
|
||||||
from __future__ import print_function
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
|
import logging
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
import logging
|
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (c) 2017-present, Facebook, Inc.
|
# Copyright (c) 2017-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
|
|
@ -5,31 +6,22 @@
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree. An additional grant
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
# of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, division, print_function
|
||||||
from __future__ import division
|
|
||||||
from __future__ import print_function
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from collections import defaultdict, OrderedDict
|
|
||||||
from datetime import timedelta
|
|
||||||
import logging
|
import logging
|
||||||
|
from collections import OrderedDict, defaultdict
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import pystan # noqa F401
|
import pystan # noqa F401
|
||||||
|
|
||||||
|
|
||||||
from fbprophet.diagnostics import prophet_copy
|
from fbprophet.diagnostics import prophet_copy
|
||||||
from fbprophet.models import prophet_stan_model
|
|
||||||
from fbprophet.make_holidays import get_holiday_names, make_holidays_df
|
from fbprophet.make_holidays import get_holiday_names, make_holidays_df
|
||||||
from fbprophet.plot import (
|
from fbprophet.models import prophet_stan_model
|
||||||
plot,
|
from fbprophet.plot import (plot, plot_components, plot_forecast_component,
|
||||||
plot_components,
|
plot_seasonality, plot_weekly, plot_yearly,
|
||||||
plot_forecast_component,
|
seasonality_plot_df)
|
||||||
seasonality_plot_df,
|
|
||||||
plot_weekly,
|
|
||||||
plot_yearly,
|
|
||||||
plot_seasonality,
|
|
||||||
)
|
|
||||||
|
|
||||||
logger = logging.getLogger('fbprophet')
|
logger = logging.getLogger('fbprophet')
|
||||||
logger.addHandler(logging.NullHandler())
|
logger.addHandler(logging.NullHandler())
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (c) 2017-present, Facebook, Inc.
|
# Copyright (c) 2017-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
|
|
@ -5,17 +6,15 @@
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree. An additional grant
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
# of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, division, print_function
|
||||||
from __future__ import division
|
|
||||||
from __future__ import print_function
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from holidays import HolidayBase, MONDAY, WEEKEND, rd, easter
|
import warnings
|
||||||
from lunardate import LunarDate
|
|
||||||
from calendar import Calendar
|
from calendar import Calendar
|
||||||
from datetime import date, timedelta
|
from datetime import date, timedelta
|
||||||
from convertdate.islamic import to_gregorian, from_gregorian
|
|
||||||
import warnings
|
from convertdate.islamic import from_gregorian, to_gregorian
|
||||||
|
from holidays import MONDAY, WEEKEND, HolidayBase, easter, rd
|
||||||
|
from lunardate import LunarDate
|
||||||
|
|
||||||
|
|
||||||
# Official public holidays at a country level
|
# Official public holidays at a country level
|
||||||
|
|
@ -927,7 +926,7 @@ class Turkey(HolidayBase):
|
||||||
self[date(year, 5, 1)] = name
|
self[date(year, 5, 1)] = name
|
||||||
|
|
||||||
# Commemoration of Atatürk, Youth and Sports Day
|
# Commemoration of Atatürk, Youth and Sports Day
|
||||||
name = "Commemoration of Atatürk, Youth and Sports Day"
|
name = u"Commemoration of Atatürk, Youth and Sports Day"
|
||||||
self[date(year, 5, 19)] = name
|
self[date(year, 5, 19)] = name
|
||||||
|
|
||||||
# Democracy and National Unity Day
|
# Democracy and National Unity Day
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (c) 2017-present, Facebook, Inc.
|
# Copyright (c) 2017-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
|
|
@ -5,16 +6,15 @@
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree. An additional grant
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
# of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, division, print_function
|
||||||
from __future__ import division
|
|
||||||
from __future__ import print_function
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import pandas as pd
|
|
||||||
import numpy as np
|
|
||||||
import warnings
|
import warnings
|
||||||
import holidays as hdays_part1
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
import fbprophet.hdays as hdays_part2
|
import fbprophet.hdays as hdays_part2
|
||||||
|
import holidays as hdays_part1
|
||||||
|
|
||||||
|
|
||||||
def get_holiday_names(country):
|
def get_holiday_names(country):
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (c) 2017-present, Facebook, Inc.
|
# Copyright (c) 2017-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
|
|
@ -5,12 +6,10 @@
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree. An additional grant
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
# of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, division, print_function
|
||||||
from __future__ import division
|
|
||||||
from __future__ import print_function
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import pickle
|
import pickle
|
||||||
|
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (c) 2017-present, Facebook, Inc.
|
# Copyright (c) 2017-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
|
|
@ -5,10 +6,7 @@
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree. An additional grant
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
# of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, division, print_function
|
||||||
from __future__ import division
|
|
||||||
from __future__ import print_function
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,3 +6,4 @@ matplotlib>=2.0.0
|
||||||
lunardate>=0.1.5
|
lunardate>=0.1.5
|
||||||
convertdate>=2.1.2
|
convertdate>=2.1.2
|
||||||
holidays>=0.9.5
|
holidays>=0.9.5
|
||||||
|
setuptools-git>=1.2
|
||||||
|
|
@ -100,7 +100,7 @@ setup(
|
||||||
name='fbprophet',
|
name='fbprophet',
|
||||||
version='0.4',
|
version='0.4',
|
||||||
description='Automatic Forecasting Procedure',
|
description='Automatic Forecasting Procedure',
|
||||||
url='https://facebook.github.io/prophet/',
|
url='facebook.github.io/prophet/',
|
||||||
author='Sean J. Taylor <sjt@fb.com>, Ben Letham <bletham@fb.com>',
|
author='Sean J. Taylor <sjt@fb.com>, Ben Letham <bletham@fb.com>',
|
||||||
author_email='sjt@fb.com',
|
author_email='sjt@fb.com',
|
||||||
license='BSD',
|
license='BSD',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue