mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-18 08:53:42 +00:00
adding no history error handling to cross_validation (#2140)
This commit is contained in:
parent
0a44095570
commit
cc5484c4e3
1 changed files with 4 additions and 1 deletions
|
|
@ -115,6 +115,9 @@ def cross_validation(model, horizon, period=None, initial=None, parallel=None, c
|
||||||
A pd.DataFrame with the forecast, actual value and cutoff.
|
A pd.DataFrame with the forecast, actual value and cutoff.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if model.history is None:
|
||||||
|
raise Exception('Model has not been fit. Fitting the model provides contextual parameters for cross validation.')
|
||||||
|
|
||||||
df = model.history.copy().reset_index(drop=True)
|
df = model.history.copy().reset_index(drop=True)
|
||||||
horizon = pd.Timedelta(horizon)
|
horizon = pd.Timedelta(horizon)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue