From eb6b8f60ec6aefdb1dce22519a93a68a295b7658 Mon Sep 17 00:00:00 2001 From: Ben Letham Date: Wed, 3 Mar 2021 18:40:27 -0800 Subject: [PATCH] Enable cross validation on a deserialized model (#1709) --- python/fbprophet/diagnostics.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/fbprophet/diagnostics.py b/python/fbprophet/diagnostics.py index 7b4a5b3..3c2dec4 100644 --- a/python/fbprophet/diagnostics.py +++ b/python/fbprophet/diagnostics.py @@ -301,7 +301,10 @@ def prophet_copy(m, cutoff=None): mcmc_samples=m.mcmc_samples, interval_width=m.interval_width, uncertainty_samples=m.uncertainty_samples, - stan_backend=m.stan_backend.get_type() + stan_backend=( + m.stan_backend.get_type() if m.stan_backend is not None + else None + ), ) m2.extra_regressors = deepcopy(m.extra_regressors) m2.seasonalities = deepcopy(m.seasonalities)