Skip to content

Commit

Permalink
Merge pull request #44 from boost-R/fix_stabsel_plot
Browse files Browse the repository at this point in the history
Fix stabsel plot; closes #40
  • Loading branch information
hofnerb committed May 3, 2017
2 parents 88449e3 + 36aee6e commit 658599c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/mboostLSS.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ mboostLSS_fit <- function(formula, data = list(), families = GaussianLSS(),
# this is the case for boosting from the beginning
if (is.null(attr(fit, "combined_risk")) | niter == 0) {
combined_risk <- vapply(fit, risk, numeric(1))
} else {
combined_risk <- attr(fit, "combined_risk")()
}

best <- which(names(fit) == tail(names(combined_risk), 1))
Expand Down
9 changes: 9 additions & 0 deletions tests/regtest-noncyclic_fitting.R
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,12 @@ model <- glmboostLSS(y ~ ., families = NBinomialLSS(), data = dat,
selected(model) # ok (at least in principle)
selected(model, merge = TRUE) ## BROKEN


## Check merged risk for reducing mstop to 0, and increasing it again does not contain an NA
stopifnot(all(!is.na(risk(model, merge = TRUE))))
mstop(model) <- 0
stopifnot(all(!is.na(risk(model, merge = TRUE))))
mstop(model) <- 10
stopifnot(all(!is.na(risk(model, merge = TRUE))))


0 comments on commit 658599c

Please sign in to comment.