Boosting algorithms for fitting generalized linear, additive and interaction models to potentially high-dimensional data. The current relase version can be found on CRAN (http://cran.r-project.org/package=mboost).
In the following, a MWE is given were the problem occurs in predict().
library(mboost)
### kronecker product for matrix-valued responses
data("volcano", package = "datasets")
## estimate mean of image treating image as matrix
x1 <- 1:nrow(volcano)
x2 <- 1:ncol(volcano)
vol <- as.vector(volcano)
mod <- mboost(vol ~ bbs(x1, df = 3, knots = 10)%O%
bbs(x2, df = 3, knots = 10),
control = boost_control(nu = 0.25))
## use predict() with newdata that extrapolates the original variables
## does not work as the arument 'prediciton' is not passed in %O%
temp <- matrix(predict(mod, newdata=list(x1=x1, x2=1:62)), nrow = nrow(volcano))
In the
args
ofhyper_bbs()
the argumentprediction
is used to tell the base-learner when the model is fitted and when it is just used for prediction. I just realized that this argument is not passed when the base-learner is used in combination with%O%
, as the argument is not passed innewX1
andnewX2
, in the code lines https://github.com/hofnerb/mboost/blob/master/pkg/mboostPatch/R/bkronecker.R#L244 https://github.com/hofnerb/mboost/blob/master/pkg/mboostPatch/R/bkronecker.R#L254I think the bug can be fixed by setting
respectively.
In the following, a MWE is given were the problem occurs in predict().
I suspect, that the same issue applies for
%X%
and%+%
, as in those functionsprediction
is not passed explicitly either, see e.g. , https://github.com/hofnerb/mboost/blob/master/pkg/mboostPatch/R/bl.R#L1088 However, I did not check in that cases.