"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "python/prophet/tests/test_prophet.py" between
prophet-1.1.tar.gz and prophet-1.1.1.tar.gz

About: Prophet is a tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.

test_prophet.py  (prophet-1.1):test_prophet.py  (prophet-1.1.1)
skipping to change at line 76 skipping to change at line 76
@skipUnless("--test-slow" in sys.argv, "Skipped due to the lack of '--test-s low' argument") @skipUnless("--test-slow" in sys.argv, "Skipped due to the lack of '--test-s low' argument")
def test_fit_sampling_predict(self): def test_fit_sampling_predict(self):
days = 30 days = 30
N = DATA.shape[0] N = DATA.shape[0]
train = DATA.head(N - days) train = DATA.head(N - days)
test = DATA.tail(days) test = DATA.tail(days)
test.reset_index(inplace=True) test.reset_index(inplace=True)
forecaster = Prophet(mcmc_samples=500) forecaster = Prophet(mcmc_samples=500)
forecaster.fit(train, seed=1237861298, chains=4) # chains adjusted from 4 to 7 to satisfy test for cmdstanpy
forecaster.fit(train, seed=1237861298, chains=7)
np.random.seed(876543987) np.random.seed(876543987)
future = forecaster.make_future_dataframe(days, include_history=False) future = forecaster.make_future_dataframe(days, include_history=False)
future = forecaster.predict(future) future = forecaster.predict(future)
# this gives ~ 215.77 # this gives ~ 215.77
res = self.rmse(future['yhat'], test['y']) res = self.rmse(future['yhat'], test['y'])
self.assertTrue(236 > res > 193, msg="backend: {}".format(forecaster.sta n_backend)) self.assertTrue(236 > res > 193, msg="backend: {}".format(forecaster.sta n_backend))
def test_fit_predict_no_seasons(self): def test_fit_predict_no_seasons(self):
N = DATA.shape[0] N = DATA.shape[0]
train = DATA.head(N // 2) train = DATA.head(N // 2)
future = DATA.tail(N // 2) periods = 30
forecaster = Prophet(weekly_seasonality=False, forecaster = Prophet(weekly_seasonality=False,
yearly_seasonality=False) yearly_seasonality=False)
forecaster.fit(train) forecaster.fit(train)
forecaster.predict(future) future = forecaster.make_future_dataframe(periods=periods, include_histo
ry=False)
result = forecaster.predict(future)
self.assertTrue((future.ds == result.ds).all())
def test_fit_predict_no_changepoints(self): def test_fit_predict_no_changepoints(self):
N = DATA.shape[0] N = DATA.shape[0]
train = DATA.head(N // 2) train = DATA.head(N // 2)
future = DATA.tail(N // 2) future = DATA.tail(N // 2)
forecaster = Prophet(n_changepoints=0) forecaster = Prophet(n_changepoints=0)
forecaster.fit(train) forecaster.fit(train)
forecaster.predict(future) forecaster.predict(future)
 End of changes. 3 change blocks. 
3 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)