mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-18 08:53:42 +00:00
Add test for cv in diagnostics
This commit is contained in:
parent
c9e3a83188
commit
3134c7ff5a
2 changed files with 11 additions and 4 deletions
|
|
@ -105,6 +105,14 @@ class TestDiagnostics(TestCase):
|
||||||
self.assertAlmostEqual(
|
self.assertAlmostEqual(
|
||||||
((df_cv1['yhat'] - df_cv2['yhat']) ** 2).sum(), 0.0)
|
((df_cv1['yhat'] - df_cv2['yhat']) ** 2).sum(), 0.0)
|
||||||
|
|
||||||
|
def test_cross_validation_uncertainty_disabled(self):
|
||||||
|
df = self.__df.copy()
|
||||||
|
m = Prophet(uncertainty_samples=0)
|
||||||
|
m.fit(df)
|
||||||
|
df_cv = diagnostics.cross_validation(
|
||||||
|
m, horizon='4 days', period='4 days', initial='115 days')
|
||||||
|
self.assertListEqual(['ds', 'yhat', 'y', 'cutoff'], df_cv.columns.tolist())
|
||||||
|
|
||||||
def test_performance_metrics(self):
|
def test_performance_metrics(self):
|
||||||
m = Prophet()
|
m = Prophet()
|
||||||
m.fit(self.__df)
|
m.fit(self.__df)
|
||||||
|
|
|
||||||
|
|
@ -101,10 +101,9 @@ class TestProphet(TestCase):
|
||||||
m = Prophet(uncertainty_samples=0)
|
m = Prophet(uncertainty_samples=0)
|
||||||
m.fit(train)
|
m.fit(train)
|
||||||
fcst = m.predict(future)
|
fcst = m.predict(future)
|
||||||
self.assertNotIn('yhat_lower', list(fcst.columns))
|
self.assertListEqual(['ds', 'trend', 'additive_terms', 'weekly',
|
||||||
self.assertNotIn('yhat_upper', list(fcst.columns))
|
'multiplicative_terms', 'yhat'], fcst.columns.tolist())
|
||||||
self.assertNotIn('trend_lower', list(fcst.columns))
|
|
||||||
self.assertNotIn('trend_upper', list(fcst.columns))
|
|
||||||
|
|
||||||
def test_setup_dataframe(self):
|
def test_setup_dataframe(self):
|
||||||
m = Prophet()
|
m = Prophet()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue