Adds optional retained fields from the fit result and data bundle to the task result based on the retention policy.
Arguments
- task_result
A bayesim_task_result object to modify
- fit_result
A bayesim_fit_result object (before retention applied)
- data_bundle
Data bundle from generator containing train/test data
- retain
Character vector of retention options specifying what to keep
- predictions
Prediction context returned by
predict_fit(), or NULL.