Bug
When performing cross validation with prediction intervals enabled and setting fitted=True to be able to retrieve the in-sample predictions, only the last fold is included in the in-sample data.
Expected behaviour
All folds should be present in the output
Useful information
This is due to the nested cross-validation to fit the conformal prediction intervals inside the explicitly called cross_validation, more specifically, the in-sample predictions are reset to an empty list here: https://github.com/Nixtla/mlforecast/blob/5b08a3ef3d2e448916b6aa74bb8e74814090a2cf/mlforecast/forecast.py#L844
The last fold will run cross_validation to fit conformal prediction, resetting the attribute, after which the in-sample predictions of the last fold are appended, resulting in only in-sample predictions of the last fold.
What happened + What you expected to happen
Bug When performing cross validation with prediction intervals enabled and setting fitted=True to be able to retrieve the in-sample predictions, only the last fold is included in the in-sample data. Expected behaviour All folds should be present in the output Useful information This is due to the nested cross-validation to fit the conformal prediction intervals inside the explicitly called cross_validation, more specifically, the in-sample predictions are reset to an empty list here: https://github.com/Nixtla/mlforecast/blob/5b08a3ef3d2e448916b6aa74bb8e74814090a2cf/mlforecast/forecast.py#L844 The last fold will run cross_validation to fit conformal prediction, resetting the attribute, after which the in-sample predictions of the last fold are appended, resulting in only in-sample predictions of the last fold.
Versions / Dependencies
mlforecast: 0.12.0 datasetsforecast: 0.0.8 lightgbm: 4.3.0
python: 3.10.14 OS: macOS Monterey v12.6
Reproduction script
Issue Severity
High: It blocks me from completing my task.