本文整理汇总了Python中fbprophet.Prophet.get_changepoint_matrix方法的典型用法代码示例。如果您正苦于以下问题:Python Prophet.get_changepoint_matrix方法的具体用法?Python Prophet.get_changepoint_matrix怎么用?Python Prophet.get_changepoint_matrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fbprophet.Prophet
的用法示例。
在下文中一共展示了Prophet.get_changepoint_matrix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_zero_changepoints
# 需要导入模块: from fbprophet import Prophet [as 别名]
# 或者: from fbprophet.Prophet import get_changepoint_matrix [as 别名]
def test_get_zero_changepoints(self):
m = Prophet(n_changepoints=0)
N = DATA.shape[0]
history = DATA.head(N // 2).copy()
history = m.setup_dataframe(history, initialize_scales=True)
m.history = history
m.set_changepoints()
cp = m.changepoints_t
self.assertEqual(cp.shape[0], 1)
self.assertEqual(cp[0], 0)
mat = m.get_changepoint_matrix()
self.assertEqual(mat.shape[0], N // 2)
self.assertEqual(mat.shape[1], 1)
示例2: test_get_changepoints
# 需要导入模块: from fbprophet import Prophet [as 别名]
# 或者: from fbprophet.Prophet import get_changepoint_matrix [as 别名]
def test_get_changepoints(self):
m = Prophet()
N = DATA.shape[0]
history = DATA.head(N // 2).copy()
history = m.setup_dataframe(history, initialize_scales=True)
m.history = history
m.set_changepoints()
cp = m.changepoints_t
self.assertEqual(cp.shape[0], m.n_changepoints)
self.assertEqual(len(cp.shape), 1)
self.assertTrue(cp.min() > 0)
self.assertTrue(cp.max() < N)
mat = m.get_changepoint_matrix()
self.assertEqual(mat.shape[0], N // 2)
self.assertEqual(mat.shape[1], m.n_changepoints)