mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-06-07 00:13:24 +00:00
if optimization fails fallback to Newton even if algorithm is specified (#890)
This commit is contained in:
parent
730e59e2f7
commit
eec2f46ac5
1 changed files with 4 additions and 6 deletions
|
|
@ -1096,12 +1096,10 @@ class Prophet(object):
|
|||
try:
|
||||
params = model.optimizing(**args)
|
||||
except RuntimeError:
|
||||
if 'algorithm' not in args:
|
||||
# Fall back on Newton
|
||||
args['algorithm'] = 'Newton'
|
||||
params = model.optimizing(**args)
|
||||
else:
|
||||
raise
|
||||
# Fall back on Newton
|
||||
args['algorithm'] = 'Newton'
|
||||
params = model.optimizing(**args)
|
||||
|
||||
for par in params:
|
||||
self.params[par] = params[par].reshape((1, -1))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue