Someone can show me an example of syntax of Facebook Prophet with gluonTS please.
Thank You
Someone can show me an example of syntax of Facebook Prophet with gluonTS please.
Thank You
from gluonts.model.prophet import ProphetPredictor
from gluonts.dataset.common import ListDataset
dataset = ListDataset(
[
{"target": [1, 5, 3, 4, 9, 6, 7, 8, 9, 10], "start": "2018-12-21"}
],
freq="D"
)
predictor = ProphetPredictor("D", 7)
predictions = predictor.predict(dataset)
import pandas as pd
pd.plotting.register_matplotlib_converters()
from gluonts.dataset.util import to_pandas
from matplotlib import pyplot as plt
prediction_intervals = (50.0, 90.0)
legend = ["observations", "median prediction"] + [f"{k}% prediction interval" for k in prediction_intervals][::-1]
for x, y in zip(dataset, predictions):
to_pandas(x).plot()
y.plot(color='g', prediction_intervals=prediction_intervals)
plt.grid(which='both')
plt.legend(legend, loc='upper left')
plt.show()