Loading prerequisites
We can fit a direct engine MARS model with the earth
(Enhanced Adaptive Regression Through Hinges) package, as “MARS” is trademarked and licensed exclusively to Salford Systems and cannot be used for competing software solutions.
7.0.1 Libraries to use
# Helper packages for data wrangling and awesome plotting
library(dplyr)
library(recipes)
library(ggplot2)
# Modeling packages for fitting MARS models
# and automating the tuning process
library(earth)
library(caret)
library(rsample)
library(parsnip)
# Model interpretability packages
# for variable importance and relationships
library(vip)
library(pdp)