本文整理汇总了Python中fbprophet.Prophet.add_country_holidays方法的典型用法代码示例。如果您正苦于以下问题:Python Prophet.add_country_holidays方法的具体用法?Python Prophet.add_country_holidays怎么用?Python Prophet.add_country_holidays使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fbprophet.Prophet
的用法示例。
在下文中一共展示了Prophet.add_country_holidays方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_fit_predict_with_country_holidays
# 需要导入模块: from fbprophet import Prophet [as 别名]
# 或者: from fbprophet.Prophet import add_country_holidays [as 别名]
def test_fit_predict_with_country_holidays(self):
holidays = pd.DataFrame({
'ds': pd.to_datetime(['2012-06-06', '2013-06-06']),
'holiday': ['seans-bday'] * 2,
'lower_window': [0] * 2,
'upper_window': [1] * 2,
})
# Test with holidays and country_holidays
model = Prophet(holidays=holidays, uncertainty_samples=0)
model.add_country_holidays(country_name='US')
model.fit(DATA).predict()
# There are training holidays missing in the test set
train = DATA.head(154)
future = DATA.tail(355)
model = Prophet(uncertainty_samples=0)
model.add_country_holidays(country_name='US')
model.fit(train).predict(future)
# There are test holidays missing in the training set
train = DATA.tail(355)
future = DATA2
model = Prophet(uncertainty_samples=0)
model.add_country_holidays(country_name='US')
model.fit(train).predict(future)