Integer verbose (deprecate global options projpred.extra_verbose and projpred.verbose_project)#519
Merged
Merged
Conversation
Collaborator
Author
|
For illustration: data("df_gaussian", package = "projpred")
df_gaussian <- df_gaussian[1:29, ]
dat <- data.frame(y = df_gaussian$y, df_gaussian$x)
rfit <- rstanarm::stan_glm(y ~ X1 + X2 + X3 + X4 + X5,
data = dat,
chains = 1,
iter = 500,
seed = 1140350788,
refresh = 0)
devtools::load_all(".")
### New global option `projpred.verbose` (which only serves the purpose of
### setting argument `verbose` of project(), varsel(), and cv_varsel() globally):
# options(projpred.verbose = 4)
# options(projpred.verbose = 0)
### Deprecated global option `projpred.extra_verbose`:
# options(projpred.extra_verbose = TRUE)
# options(projpred.extra_verbose = FALSE)
###
### Deprecated global option `projpred.verbose_project`:
# options(projpred.verbose_project = TRUE)
# options(projpred.verbose_project = FALSE)
###
prj <- project(rfit,
predictor_terms = c("X1", "X2"),
verbose = 2,
seed = 46782345)
vs <- varsel(rfit,
method = "forward",
nclusters = 1,
nclusters_pred = 1,
refit_prj = TRUE,
nterms_max = 1,
verbose = 4,
seed = 46782345)
prj_vs <- project(vs,
predictor_terms = c("X1", "X2"),
verbose = 2,
seed = 46782345)
prj_vs <- project(vs,
nterms = c(0, 1),
verbose = 2,
seed = 46782345)
cvvs <- cv_varsel(rfit,
nloo = 4,
method = "forward",
nclusters = 1,
nclusters_pred = 1,
refit_prj = TRUE,
nterms_max = 1,
verbose = 4,
seed = 46782345)
cvvs <- cv_varsel(rfit,
cv_method = "kfold",
K = 2,
method = "forward",
nclusters = 1,
nclusters_pred = 1,
refit_prj = TRUE,
nterms_max = 1,
verbose = 4,
seed = 46782345)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow-up for PR #518: With #518 now being merged, this PR turns argument
verboseofproject(),varsel(), andcv_varsel()from logical to integer, which is common practice in R packages (see, e.g., argumentsilentofbrms::brm()). This way, global optionsprojpred.extra_verboseandprojpred.verbose_projectare now deprecated (which is desired, as they made it too complicated to achieve the desired verbosity).File
NEWS.mdis unchanged here. I will update it as soon as #511 (or #508) has been merged. I would propose to add the following entry under "Major changes":and to change the following entry:
(which was proposed to be changed to
in #518) to: