library(parsnip)
library(rpart)
# Create model and fit
lm_fit <- linear_reg() |>
set_engine("lm") |>
fit(mpg ~ ., data = mtcars)
out <- butcher(lm_fit, verbose = TRUE)
# Another parsnip model
gam_fit <- gen_additive_mod() |>
set_mode("regression") |>
fit(mpg ~ s(disp) + wt + gear, data = mtcars)
out <- butcher(gam_fit, verbose = TRUE)
Run the code above in your browser using DataLab