Calling `cross_validation(model)` without `model.fit` throws AttributeError
- Dominant language
- Python
- Stars
- 20.4k
- Forks
- 4.6k
- Avg merge
- 19h 52m
- Merged PRs (30d)
- 1
Description
Calling `cross_validation(model)` without calling `model.fit` first throws AttributeError.
```
[def cross_validation(model, horizon, period=None, initial=None, parallel=None, cutoffs=None):]()
...
df = model.history.copy().reset_index(drop=True]()
AttributeError: 'NoneType' object has no attribute 'copy']()
```
1. If `fit` is required to be run before `cross_validation`, I would expect an appropriate error to be thrown with an actionable fix by the user.
2. Assuming that the assumption in 1) is true, why does `fit` have to be called first? As I understand, `fit` uses the entire history to fit the model. Even though `cross_validation` purports to fit using each fold, it's not obvious from the API that the preceding `fit` procedure won't cause temporal leakage.
Contributor guide
Assessment
This issue has not been assessed yet.