plot.GeDSboost | R Documentation |
Plots the component functions of a GeDSboost object fitted using
NGeDSboost
. If the model has a single base-learner, the plot
will be returned on the response scale. Otherwise, plots are produced on the
linear predictor scale. Note that only univariate base-learner plots are
returned, as the representation of the boosted model as a single spline model
is available only for univariate base-learners (see Dimitrova et al. (2025)).
Additionally, since component-wise gradient boosting inherently performs
base-learner selection, plots will only be generated for the base-learners
selected during the boosting iterations.
## S3 method for class 'GeDSboost'
plot(x, n = 3L, ...)
x |
A GeDSboost object, as returned by |
n |
Integer value (2, 3 or 4) specifying the order ( |
... |
Further arguments to be passed to the
|
Dimitrova, D. S., Kaishev, V. K. and Saenz Guillen, E. L. (2025). GeDS: An R Package for Regression, Generalized Additive Models and Functional Gradient Boosting, based on Geometrically Designed (GeD) Splines. Manuscript submitted for publication.
NGeDSboost
data(mtcars)
# Convert specified variables to factors
categorical_vars <- c("cyl", "vs", "am", "gear", "carb")
mtcars[categorical_vars] <- lapply(mtcars[categorical_vars], factor)
N <- nrow(mtcars); ratio <- 0.8
set.seed(123)
trainIndex <- sample(1:N, size = floor(ratio * N))
# Subset the data into training and test sets
train <- mtcars[trainIndex, ]
test <- mtcars[-trainIndex, ]
Gmodboost <- NGeDSboost(mpg ~ cyl + f(drat) + f(wt) + f(hp) + vs + am,
data = train, phi = 0.7, shrinkage = 0.9, initial_learner = FALSE)
par(mfrow = c(2,3))
plot(Gmodboost, n = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.