From e9c017ba017e8664593e6ed50707e83351ce3b3d Mon Sep 17 00:00:00 2001 From: Ben Letham Date: Tue, 7 May 2019 11:47:36 -0700 Subject: [PATCH] Default to Newton optimizer if less than 100 datapoints (#842, #870, #888) --- R/R/prophet.R | 1 + python/fbprophet/forecaster.py | 1 + 2 files changed, 2 insertions(+) diff --git a/R/R/prophet.R b/R/R/prophet.R index fd971a9..337a349 100644 --- a/R/R/prophet.R +++ b/R/R/prophet.R @@ -1257,6 +1257,7 @@ fit.prophet <- function(m, df, ...) { object = model, data = dat, init = stan_init, + algorithm = if(dat$T < 100) {'Newton'} else {'LBFGS'}, iter = 1e4, as_vector = FALSE ) diff --git a/python/fbprophet/forecaster.py b/python/fbprophet/forecaster.py index abd8182..d8096ca 100644 --- a/python/fbprophet/forecaster.py +++ b/python/fbprophet/forecaster.py @@ -1114,6 +1114,7 @@ class Prophet(object): args = dict( data=dat, init=stan_init, + algorithm='Newton' if dat['T'] < 100 else 'LBFGS', iter=1e4, ) args.update(kwargs)