get_coef_path {sgboost} | R Documentation |
Path of aggregated and raw coefficients in a sparse-group boosting model
Description
Computes the aggregated coefficients from group and individual baselearners for each boosting iteration.
Usage
get_coef_path(sgb_model)
Arguments
sgb_model |
Model of type |
Details
in a sparse-group boosting models a variable in a dataset can be selected as an individual variable or as a group. Therefore there can be two associated effect sizes for the same variable. This function aggregates both and returns it in a data.frame for each boosting iteration
Value
List of data.frames containing the a data.frame $raw
with the
variable and the raw (Regression) coefficients and the data.frame $aggregated
with the
aggregated (Regression) coefficients.
See Also
Examples
library(mboost)
library(dplyr)
set.seed(1)
df <- data.frame(
x1 = rnorm(100), x2 = rnorm(100), x3 = rnorm(100),
x4 = rnorm(100), x5 = runif(100)
)
df <- df %>%
mutate_all(function(x) {
as.numeric(scale(x))
})
df$y <- df$x1 + df$x4 + df$x5
group_df <- data.frame(
group_name = c(1, 1, 1, 2, 2),
var_name = c("x1", "x2", "x3", "x4", "x5")
)
sgb_formula <- create_formula(alpha = 0.3, group_df = group_df)
sgb_model <- mboost(formula = sgb_formula, data = df)
sgb_coef_path <- get_coef_path(sgb_model)
[Package sgboost version 0.1.3 Index]