Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jeffery-leirness-noaa opened this issue Apr 4, 2019 · 3 comments
Assignees

Comments

@jeffery-leirness-noaa
Copy link

jeffery-leirness-noaa commented Apr 4, 2019

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
Copy link
Member

hofnerb commented Apr 5, 2019

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

@mayrandy
Copy link
Member

mayrandy commented Apr 5, 2019

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

@mayrandy
Copy link
Member

mayrandy commented Apr 5, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants