mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-05-25 22:26:34 +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
|
|
@ -114,7 +114,10 @@ def cross_validation(model, horizon, period=None, initial=None, parallel=None, c
|
|||
-------
|
||||
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)
|
||||
horizon = pd.Timedelta(horizon)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue