Skip to content

Commit c1a25dc

Browse files
committed
Merge branch 'master' of https://github.com/boost-R/FDboost
2 parents d7aa0c4 + 5778cba commit c1a25dc

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

R/FDboost.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,19 @@
398398
#' ## plot(mod4)
399399
#' ## plotPredicted(mod4, lwdPred = 2)
400400
#'
401+
#' \donttest{
402+
#' ## Find optimal mstop, small grid/low B for a fast example
403+
#' set.seed(123)
404+
#' folds4 <- cv(rep(1, length(unique(mod4$id))), B = 3)
405+
#' appl4 <- applyFolds(mod4, folds = folds4, grid = 1:50)
406+
#' ## val4 <- validateFDboost(mod4, folds = folds4, grid = 1:50)
407+
#'
408+
#' set.seed(123)
409+
#' folds4long <- cvLong(id = mod4$id, weights = model.weights(mod4), B = 3)
410+
#' cvm4 <- cvrisk(mod4, folds = folds4long, grid = 1:50)
411+
#' mstop(cvm4)
412+
#' }
413+
#'
401414
#' ## Be careful if you want to predict newdata with irregular response,
402415
#' ## as the argument index is not considered in the prediction of newdata.
403416
#' ## Thus, all covariates have to be repeated according to the number of observations

R/utilityFunctions.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,8 @@ reweightData <- function(data, argvals, vars,
11841184
i <- i + 1
11851185
}
11861186
idvars_new <- c(factor(my_temp_idvars))
1187+
# regain 1:n ids format expected by FDboost
1188+
idvars_new <- as.numeric(idvars_new)
11871189
## check whether id variable of hmatrix-object and id variable of long variables are equal
11881190
if(!is.null(idvars_new_hmatrix)){
11891191
if(!all(idvars_new == idvars_new_hmatrix))

0 commit comments

Comments
 (0)