Residual plot of model

viz_residuals(fit, new_data)

Arguments

fit

a parsnip model object

new_data

A data frame or matrix.

Value

a ggplot2 object

Examples

library(parsnip) reg <- linear_reg() %>% set_engine("lm") %>% set_mode("regression") %>% fit(mpg ~ ., data = mtcars) viz_residuals(reg, mtcars)
linear_reg() %>% set_engine("lm") %>% set_mode("regression") %>% fit(mpg ~ ., data = mtcars) %>% viz_residuals(mtcars)