mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-06-11 00:49:35 +00:00
Fall back to Newton optimizer if LBFGS fails
This commit is contained in:
parent
3ebedb1110
commit
f7becb0942
1 changed files with 8 additions and 1 deletions
|
|
@ -539,7 +539,14 @@ class Prophet(object):
|
|||
self.params[par] = stan_fit[par]
|
||||
|
||||
else:
|
||||
params = model.optimizing(dat, init=stan_init, iter=1e4, **kwargs)
|
||||
try:
|
||||
params = model.optimizing(
|
||||
dat, init=stan_init, iter=1e4, **kwargs)
|
||||
except RuntimeError:
|
||||
params = model.optimizing(
|
||||
dat, init=stan_init, iter=1e4, algorithm='Newton',
|
||||
**kwargs
|
||||
)
|
||||
for par in params:
|
||||
self.params[par] = params[par].reshape((1, -1))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue