boost-R / gamboostLSS

Boosting models for fitting generalized additive models for location, shape and scale (GAMLSS) to potentially high dimensional data. The current relase version can be found on CRAN (https://cran.r-project.org/package=gamboostLSS).
26 stars 11 forks source link

predint() not working when multiple variables are included within a single baselearner #55

Closed jeffery-leirness-noaa closed 5 years ago

jeffery-leirness-noaa commented 5 years ago
library("gamboostLSS")
set.seed(7)
data <- data.frame(x1 = runif(400, -1, 1),
                   x2 = runif(400, -1, 1),
                   x3 = runif(400, -1, 1),
                   x4 = runif(400, -1, 1))
data$y <- rnorm(400, 4 * data$x1 + 2 * data$x3)

gb <- gamboostLSS(y ~ btree(x1, x2, x3, x4), data = data, method = "noncyclic")

## error:
predint(gb, which = "x1")

possible fix: replace pred_vars <- unique(unlist(pred_vars)) with pred_vars <- unique(trimws(unlist(strsplit(unlist(pred_vars), ",")))) in the predint() function

hofnerb commented 5 years ago

@mayrandy can you check the fix and include it if all tests and checks pass? Thanks a lot

mayrandy commented 5 years ago

Thanks @leirnessjb for finding this! The potential fit leads to other problems - but we will surely find a solution

mayrandy commented 5 years ago

My mistake, I was the one leading to other problems ;-) - the fix by @leirnessjb works fine, thanks!!