|
@@ -330,14 +330,18 @@ class TestProphet(TestCase):
|
|
|
def test_subdaily_holidays(self):
|
|
|
holidays = pd.DataFrame({
|
|
|
'ds': pd.to_datetime(['2017-01-02']),
|
|
|
- 'holiday': ['new_years'],
|
|
|
+ 'holiday': ['special_day'],
|
|
|
})
|
|
|
m = Prophet(holidays=holidays)
|
|
|
m.fit(DATA2)
|
|
|
fcst = m.predict()
|
|
|
- self.assertEqual(sum(fcst['new_years'] == 0), 575)
|
|
|
+ self.assertEqual(sum(fcst['special_day'] == 0), 575)
|
|
|
|
|
|
def test_custom_seasonality(self):
|
|
|
- m = Prophet()
|
|
|
+ holidays = pd.DataFrame({
|
|
|
+ 'ds': pd.to_datetime(['2017-01-02']),
|
|
|
+ 'holiday': ['special_day'],
|
|
|
+ })
|
|
|
+ m = Prophet(holidays=holidays)
|
|
|
m.add_seasonality(name='monthly', period=30, fourier_order=5)
|
|
|
self.assertEqual(m.seasonalities['monthly'], (30, 5))
|