Augment Data with Model Calculations
Appends model predictions, residuals, and potentially diagnostic metrics to a dataset.
data (DataFrame): The dataset to
add_diagnostics.
model (Model): The model
object.
The original DataFrame with appended fitted,
resid, etc.
df = add_diagnostics(mtcars, model)