Package encapsulating multivariate forecasting with facebook prophet.

vonum, updated 🕥 2022-11-15 13:48:16

Multi Prophet

Build Status PyPI version License: MIT

Multi Prophet is a procedure for forecasting time series data for multipe dependent variables based on Facebook Prophet package. If you have no prior experience with Facebook Prophet, check out their docs.

Multi Prophet does not train a single model with many outputs, it just wraps Facebook Prophet interface to support configuration and controll over multiple models. Multi Prophet has a very similar interface as Facebook Prophet.

The main difference is that return values of each method is a dictionary where each dependent value is a key, and the value is the return value of the linked Facebook Prophet model.

If Prophet return value is a data frame, then MultiProphet return value will be: python {"dependent_variable1": df1, "dependent_variable2": df2}

Installation

Multi Prophet is on PyPi. pip install multi-prophet

Getting started

Creating a basic model is almost the same as creating a Prophet model:

Prophet

```python

dataframe needs to have columns ds and y

from fbprophet import Prophet

m = Prophet() m.fit(df)

future = m.create_future_dataframe(df) forecast = m.predict(future) m.plot(forecast) ```

Multi Prophet

```python

dataframe needs to have column ds, and it has y1 and y2 as dependent variables

from multi_prophet import MultiProphet

m = MultiProphet(columns=["y1", "y2"]) m.fit(df)

future = m.create_future_dataframe(df) forecast = m.predict(future) m.plot(forecast) ```

Adding country holidays

Prophet

python m.add_country_holidays(country_name="US")

Multi Prophet

```python

For all dependent variables

m.add_country_holidays("US")

For selected dependent variables

m.add_country_holidays("US", columns=["y1"]) ```

Adding seasonality

Prophet

python m.add_seasonality(name="monthly", period=30.5, fourier_order=5)

Multi Prophet

```python

For all dependent variables

m.add_seasonality(name="monthly", period=30.5, fourier_order=5)

For selected dependent variables

m.add_seasonality(name="monthly", period=30.5, fourier_order=5, columns=["y1"]) ```

Adding regressors

Prophet

python m.add_regressor("Matchday")

Multi Prophet

```python

For all dependent variables

m.add_regressor("Matchday")

For selected dependent variables

m.add_regressor("Matchday", columns=["y"]) ```

Ploting results

Prophet

```python

Prophet

m.plot(forecast) m.plot_components(forecast)

With Plotly

from fbprophet.plot import plot_plotly, plot_components_plotly import plotly.offline as py py.init_notebook_mode()

fig = plot_plotly(m, forecast) py.iplot(fig)

fig = plot_components_plotly(m, forecast) py.iplot(fig) ```

Multi Prophet

```python m.plot(forecast) m.plot_components(forecast)

With Plotly

figures = m.plot(forecast, plotly=True) for fig in figures.values(): fig.show()

or access by key

figures["y1"].show()

figures = m.plot_components(forecast, plotly=True) for fig in figures.values(): fig.show()

or access by key

figures["y1"].show() ```

Facebook Prophet model configuration

Facebook Prophet supports a lot of configuration through kwargs. There are two ways to do it with Multi Prophet: 1. Through kwargs just as with Facebook Prophet * Prophet python m = Prophet(growth="logistic") m.fit(self.df, algorithm="Newton") m.make_future_dataframe(7, freq="H") m.add_regressor("Matchday", prior_scale=10)

* Multi Prophet

python m = MultiProphet(columns=["y1", "y2"], growth="logistic") m.fit(self.df, algorithm="Newton") m.make_future_dataframe(7, freq="H") m.add_regressor("Matchday", prior_scale=10)

  1. Configuration through constructor ```python

Same configuration for each dependent variable

m = MultiProphet(columns=["y1", "y2"], growth="logistic", weekly_seasonality=True, n_changepoints=50)

Different configuration for each model

config = { "y1": {"growth": "linear", "daily_seasonality": True}, "y2": {"growth": "logistic", "weekly_seasonality": True} } m = MultiProphet(columns=["y1", "y2"], config=config)

Adding regressors (dataframe has columns c1 and c2)

regressors = { "y1": [ {"name": "c1", "prior_scale": 0.5}, { "name": "c2", "prior_scale": 0.3} ], "y2": [{"name": "c2", "prior_scale": 0.3}] } m = MultiProphet(columns=["y1", "y2"], regressors=regressors) ```

Issues

Bump pillow from 9.2.0 to 9.3.0

opened on 2022-11-15 13:48:15 by dependabot[bot]

Bumps pillow from 9.2.0 to 9.3.0.

Release notes

Sourced from pillow's releases.

9.3.0

https://pillow.readthedocs.io/en/stable/releasenotes/9.3.0.html

Changes

... (truncated)

Changelog

Sourced from pillow's changelog.

9.3.0 (2022-10-29)

  • Limit SAMPLESPERPIXEL to avoid runtime DOS #6700 [wiredfool]

  • Initialize libtiff buffer when saving #6699 [radarhere]

  • Inline fname2char to fix memory leak #6329 [nulano]

  • Fix memory leaks related to text features #6330 [nulano]

  • Use double quotes for version check on old CPython on Windows #6695 [hugovk]

  • Remove backup implementation of Round for Windows platforms #6693 [cgohlke]

  • Fixed set_variation_by_name offset #6445 [radarhere]

  • Fix malloc in _imagingft.c:font_setvaraxes #6690 [cgohlke]

  • Release Python GIL when converting images using matrix operations #6418 [hmaarrfk]

  • Added ExifTags enums #6630 [radarhere]

  • Do not modify previous frame when calculating delta in PNG #6683 [radarhere]

  • Added support for reading BMP images with RLE4 compression #6674 [npjg, radarhere]

  • Decode JPEG compressed BLP1 data in original mode #6678 [radarhere]

  • Added GPS TIFF tag info #6661 [radarhere]

  • Added conversion between RGB/RGBA/RGBX and LAB #6647 [radarhere]

  • Do not attempt normalization if mode is already normal #6644 [radarhere]

... (truncated)

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/vonum/multi-prophet/network/alerts).

pip install fail

opened on 2022-11-15 08:21:05 by qiniuweihe

Encountered error while trying to install package: prophet

Releases

v1.1.0 2022-09-05 16:50:40

Supporting new version of Prophet. Relevant docs: https://facebook.github.io/prophet/

v0.3.0 2020-04-27 10:14:42

  1. Adding seasonalities by model
  2. Adding holidays by model
  3. Adding regressors by model

v0.2.0 2020-04-25 12:01:19

Configures and manages multiple Facebook Prophet models. Usage for models: 1. configuration 2. creating training and testing data sets 3. adding regressors 4. adding holidays 5. training models 6. making predictions 7. plotting results and components

Milan Keča

Am I dreaming?

GitHub Repository