mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-05-14 20:48:08 +00:00
* Rename package from fbprophet to prophet, and add shim * Untrack files that should have been ignored * Update github actions build commands
33 lines
854 B
Python
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')
|