Ben Letham 7 лет назад
Родитель
Сommit
2ab01c5d77
2 измененных файлов с 4 добавлено и 4 удалено
  1. 2 2
      R/tests/testthat/test_prophet.R
  2. 2 2
      python/fbprophet/tests/test_prophet.py

+ 2 - 2
R/tests/testthat/test_prophet.R

@@ -83,7 +83,7 @@ test_that("logistic_floor", {
   future1 <- future
   future1$cap <- 80.
   future1$floor <- 10.
-  m <- fit.prophet(m, history)
+  m <- fit.prophet(m, history, algorithm = 'Newton')
   expect_true(m$logistic.floor)
   expect_true('floor' %in% colnames(m$history))
   expect_equal(m$history$y_scaled[1], 1., tolerance = 1e-6)
@@ -96,7 +96,7 @@ test_that("logistic_floor", {
   history2$cap <- history2$cap + 10.
   future1$cap <- future1$cap + 10.
   future1$floor <- future1$floor + 10.
-  m2 <- fit.prophet(m2, history2)
+  m2 <- fit.prophet(m2, history2, algorithm = 'Newton')
   expect_equal(m2$history$y_scaled[1], 1., tolerance = 1e-6)
   fcst2 <- predict(m, future1)
   fcst2$yhat <- fcst2$yhat - 10.

+ 2 - 2
python/fbprophet/tests/test_prophet.py

@@ -118,7 +118,7 @@ class TestProphet(TestCase):
         future = DATA.tail(N // 2).copy()
         future['cap'] = 80.
         future['floor'] = 10.
-        m.fit(history)
+        m.fit(history, algorithm='Newton')
         self.assertTrue(m.logistic_floor)
         self.assertTrue('floor' in m.history)
         self.assertAlmostEqual(m.history['y_scaled'][0], 1.)
@@ -131,7 +131,7 @@ class TestProphet(TestCase):
         history2['cap'] += 10.
         future['cap'] += 10.
         future['floor'] += 10.
-        m2.fit(history2)
+        m2.fit(history2, algorithm='Newton')
         self.assertAlmostEqual(m2.history['y_scaled'][0], 1.)
         fcst2 = m2.predict(future)
         fcst2['yhat'] -= 10.