Get the prediction package from the latest trained model.
This function retrieves the latest iteration of a specified model from the cache and calls its package_prediction method to obtain a comprehensive set of predictions and metrics.
If the on-disk model file exists but cannot be deserialised (corrupt joblib).
Notes
predict_size is accepted by get_model_prediction() but only has effect if the concrete model’s package_prediction() accepts it. The original ForecasterRecursiveModel.package_prediction() does not — so this parameter is currently forward-looking API design, not yet wired end-to-end.
Examples
import tempfilefrom spotforecast2_safe.manager.predictor import get_model_prediction# When no model has been trained, get_model_prediction raises FileNotFoundError.with tempfile.TemporaryDirectory() as tmpdir:try: get_model_prediction("lgbm", model_dir=tmpdir)exceptFileNotFoundErroras e:print(type(e).__name__)assert"lgbm"instr(e)