prophet/python_shim/fbprophet/tests/test_package.py
Ben Letham 6d81543eb2
Pakage rename (#1844)
* Rename package from fbprophet to prophet, and add shim

* Untrack files that should have been ignored

* Update github actions build commands
2021-03-21 14:13:50 -07:00

33 lines
854 B
Python

# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from unittest import TestCase
import pandas as pd
from fbprophet import Prophet
from fbprophet.diagnostics import cross_validation
import fbprophet.plot as plot
DATA = pd.read_csv(
os.path.join(os.path.dirname(__file__), 'data.csv'),
parse_dates=['ds'],
)
class TestFbprophet(TestCase):
def test_shim(self):
m = Prophet()
m.fit(DATA)
future = m.make_future_dataframe(10, include_history=False)
fcst = m.predict(future)
df_cv = cross_validation(
model=m, horizon='4 days', period='10 days', initial='115 days',
)
fig = plot.plot_forecast_component(m=m, fcst=fcst, name='weekly')