Skip to content

Commit bc234fc

Browse files
committed
Address CRAN review comments
- DESCRIPTION: remove single quotes around Boruta - DESCRIPTION: add method references as authors (year) <doi:...> - fs_bayes(): replace \dontrun{} with \donttest{}, guarded on brms and limited to two single-predictor fits via max_comb_size = 1 - inst/WORDLIST: add cited author surnames
1 parent d976196 commit bc234fc

4 files changed

Lines changed: 64 additions & 40 deletions

File tree

DESCRIPTION

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,24 @@ Authors@R:
77
Description: Filter, wrapper, and embedded feature-selection methods behind a
88
consistent set of functions that share one calling convention and one
99
return type: correlation and chi-squared filters, information gain, LASSO
10-
and elastic net, Bayesian model comparison, 'Boruta', recursive feature
10+
and elastic net, Bayesian model comparison, Boruta, recursive feature
1111
elimination, random forest importance, multivariate adaptive regression
1212
splines, support vector machine recursive feature elimination, stepwise
1313
selection, and principal component / singular value decomposition
14-
helpers. Heavy modeling engines are optional and only required by the
15-
functions that use them.
14+
helpers. The implemented methods follow
15+
Tibshirani (1996) <doi:10.1111/j.2517-6161.1996.tb02080.x>,
16+
Zou and Hastie (2005) <doi:10.1111/j.1467-9868.2005.00503.x>,
17+
Friedman (1991) <doi:10.1214/aos/1176347963>,
18+
Breiman (2001) <doi:10.1023/A:1010933404324>,
19+
Guyon, Weston, Barnhill and Vapnik (2002) <doi:10.1023/A:1012487302797>,
20+
Kursa and Rudnicki (2010) <doi:10.18637/jss.v036.i11>, and
21+
Vehtari, Gelman and Gabry (2017) <doi:10.1007/s11222-016-9696-4>.
22+
Heavy modeling engines are optional and only required by the functions
23+
that use them.
1624
License: MIT + file LICENSE
1725
Encoding: UTF-8
1826
Language: en-US
1927
Roxygen: list(markdown = TRUE)
20-
RoxygenNote: 8.1.0
2128
Config/roxygen2/version: 8.1.0
2229
Depends:
2330
R (>= 4.1.0)

R/fs_bayes.R

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -656,24 +656,27 @@ bayes_pick_model <- function(results, idx, comparison = NULL,
656656
#' }
657657
#'
658658
#' @examples
659-
#' # Each candidate model compiles a Stan program, so this example is not run
660-
#' # automatically (compilation alone takes far longer than a typical example
661-
#' # budget). The same call is exercised by the package tests.
662-
#' \dontrun{
663-
#' x1 <- seq(-2, 2, length.out = 40)
664-
#' x2 <- rep(c(-1, 1), 20)
665-
#' d <- data.frame(
666-
#' y = 1 + 2 * x1 + sin(seq_len(40)),
667-
#' x1 = x1,
668-
#' x2 = x2
669-
#' )
670-
#' res <- fs_bayes(
671-
#' d, target = "y", predictors = c("x1", "x2"),
672-
#' brm_args = list(chains = 1, iter = 500, refresh = 0),
673-
#' rule = "1se", verbose = FALSE
674-
#' )
675-
#' res$selected
676-
#' res$details$loo_comparison
659+
#' # Each candidate model compiles and samples its own Stan program, so the
660+
#' # call is guarded on brms being installed and kept to two single-predictor
661+
#' # fits via max_comb_size = 1.
662+
#' \donttest{
663+
#' if (requireNamespace("brms", quietly = TRUE)) {
664+
#' x1 <- seq(-2, 2, length.out = 40)
665+
#' x2 <- rep(c(-1, 1), 20)
666+
#' d <- data.frame(
667+
#' y = 1 + 2 * x1 + sin(seq_len(40)),
668+
#' x1 = x1,
669+
#' x2 = x2
670+
#' )
671+
#' res <- fs_bayes(
672+
#' d, target = "y", predictors = c("x1", "x2"),
673+
#' max_comb_size = 1,
674+
#' brm_args = list(chains = 1, iter = 500, refresh = 0),
675+
#' rule = "1se", verbose = FALSE
676+
#' )
677+
#' print(res$selected)
678+
#' print(res$details$loo_comparison)
679+
#' }
677680
#' }
678681
#' @export
679682
fs_bayes <- function(data,

inst/WORDLIST

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ AbsCoefficient
33
Barnhill
44
Boruta
55
Boruta's
6+
Breiman
67
CMRG
8+
Friedman
9+
Gabry
10+
Gelman
711
Guyon
12+
Hastie
13+
Kursa
814
L'Ecuyer
915
MASS
1016
MLmetrics
@@ -18,7 +24,12 @@ Quinlan's
1824
RFE
1925
RSpectra
2026
Rsquared
27+
Rudnicki
28+
Tibshirani
2129
Vapnik
30+
Vehtari
31+
Weston
32+
Zou
2233
auc
2334
backticked
2435
bayes

man/fs_bayes.Rd

Lines changed: 21 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)