mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-17 08:40:56 +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:
|
try:
|
||||||
params = model.optimizing(**args)
|
params = model.optimizing(**args)
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
if 'algorithm' not in args:
|
# Fall back on Newton
|
||||||
# Fall back on Newton
|
args['algorithm'] = 'Newton'
|
||||||
args['algorithm'] = 'Newton'
|
params = model.optimizing(**args)
|
||||||
params = model.optimizing(**args)
|
|
||||||
else:
|
|
||||||
raise
|
|
||||||
for par in params:
|
for par in params:
|
||||||
self.params[par] = params[par].reshape((1, -1))
|
self.params[par] = params[par].reshape((1, -1))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue