In a recent project of us we were required to get the matrix of each baseleaner that is used for prediction. mgcv::gam allows this via predict(model, type="lpmatrix"). For mboost, we could construct this as follows:
mboost_lpmatrix <- function(object, newdata, which, what = c("X", "K"))
{
what = match.arg(what)
stopifnot(!is.null(which) & !is.null(newdata))
get("newX", environment(object$baselearner[[which]]$dpp))(newdata, prediction = TRUE)[[what]]
}
Maybe this is also helpful for others / worth including.