Skip to content

Commit 1c57fc2

Browse files
authored
RC 1.3.2 (#1274)
* more changes for #1271 * Error: SSL peer certificate or SSH remote key was not OK [www.rulequest.com] * version bump * sorted and formatted * avoid namespace/class issues * no suggests for the survival package
1 parent f70b356 commit 1c57fc2

13 files changed

+222
-178
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: parsnip
22
Title: A Common API to Modeling and Analysis Functions
3-
Version: 1.3.1.9000
3+
Version: 1.3.2
44
Authors@R: c(
55
person("Max", "Kuhn", , "max@posit.co", role = c("aut", "cre")),
66
person("Davis", "Vaughan", , "davis@posit.co", role = "aut"),

NEWS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# parsnip (development version)
1+
# parsnip 1.3.2
2+
3+
* Switch to base R pipe
4+
5+
* Requires changes for CRAN's "No Suggests" check.
6+
7+
* Avoid issues with reading from package files. (#1271)
28

39
# parsnip 1.3.1
410

R/aaa_archive.R

Lines changed: 146 additions & 145 deletions
Large diffs are not rendered by default.

R/boost_tree.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ xgb_by_tree <- function(tree, object, new_data, type, ...) {
552552
#' @param weights An optional numeric vector of case weights. Note
553553
#' that the data used for the case weights will not be used as a
554554
#' splitting variable in the model (see
555-
#' \url{https://www.rulequest.com/see5-info.html} for
555+
#' `https://www.rulequest.com/see5-info.html` for
556556
#' Quinlan's notes on case weights).
557557
#' @param minCases An integer for the smallest number of samples
558558
#' that must be put in at least two of the splits.

R/engine_docs.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ make_engine_list <- function(mod) {
208208
}
209209

210210
exts <-
211-
utils::read.delim(system.file("models.tsv", package = "parsnip")) |>
211+
model_info_table |>
212212
dplyr::filter(model == mod) |>
213213
dplyr::group_by(engine, mode) |>
214214
dplyr::summarize(extensions = sum(!is.na(pkg)), .groups = "drop") |>

man/C5.0_train.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/details_bart_dbarts.Rd

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

man/rmd/aaa.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ check_pkg_for_docs(parsnip:::extensions())
3232
make_mode_list <- function(mod, eng) {
3333
modes <- c("regression", "classification", "censored regression")
3434
exts <-
35-
utils::read.delim(system.file("models.tsv", package = "parsnip")) |>
35+
model_info_table |>
3636
dplyr::filter(model == mod & engine == eng) |>
3737
dplyr::mutate(mode = factor(mode, levels = modes)) |>
3838
dplyr::arrange(mode)
@@ -128,7 +128,7 @@ descr_models <- function(mod, eng) {
128128
129129
uses_extension <- function(mod, eng, mod_mode) {
130130
exts <-
131-
utils::read.delim(system.file("models.tsv", package = "parsnip")) |>
131+
model_info_table |>
132132
dplyr::filter(
133133
model == mod &
134134
engine == eng &

man/rmd/bart_dbarts.Rmd

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,31 +56,33 @@ Some relevant arguments that can be passed to `set_engine()`:
5656

5757
```{r}
5858
#| label: bart-cls
59-
bart(
59+
parsnip::bart(
6060
trees = integer(1),
6161
prior_terminal_node_coef = double(1),
6262
prior_terminal_node_expo = double(1),
6363
prior_outcome_range = double(1)
6464
) |>
6565
set_engine("dbarts") |>
6666
set_mode("classification") |>
67-
translate()
67+
translate() |>
68+
print_model_spec()
6869
```
6970

7071

7172
## Translation from parsnip to the original package (regression)
7273

7374
```{r}
7475
#| label: bart-reg
75-
bart(
76+
parsnip::bart(
7677
trees = integer(1),
7778
prior_terminal_node_coef = double(1),
7879
prior_terminal_node_expo = double(1),
7980
prior_outcome_range = double(1)
8081
) |>
8182
set_engine("dbarts") |>
8283
set_mode("regression") |>
83-
translate()
84+
translate()|>
85+
print_model_spec()
8486
```
8587

8688
## Preprocessing requirements

man/rmd/bart_dbarts.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,43 +41,67 @@ Some relevant arguments that can be passed to `set_engine()`:
4141

4242

4343
``` r
44-
bart(
44+
parsnip::bart(
4545
trees = integer(1),
4646
prior_terminal_node_coef = double(1),
4747
prior_terminal_node_expo = double(1),
4848
prior_outcome_range = double(1)
4949
) |>
5050
set_engine("dbarts") |>
5151
set_mode("classification") |>
52-
translate()
52+
translate() |>
53+
print_model_spec()
5354
```
5455

5556
```
57+
## BART Model Specification (classification)
5658
##
57-
## Call:
58-
## NULL
59+
## Main Arguments:
60+
## trees = integer(1)
61+
## prior_terminal_node_coef = double(1)
62+
## prior_terminal_node_expo = double(1)
63+
## prior_outcome_range = double(1)
64+
##
65+
## Computational engine: dbarts
66+
##
67+
## Model fit template:
68+
## dbarts::bart(x = missing_arg(), y = missing_arg(), ntree = integer(1),
69+
## base = double(1), power = double(1), k = double(1), verbose = FALSE,
70+
## keeptrees = TRUE, keepcall = FALSE)
5971
```
6072

6173

6274
## Translation from parsnip to the original package (regression)
6375

6476

6577
``` r
66-
bart(
78+
parsnip::bart(
6779
trees = integer(1),
6880
prior_terminal_node_coef = double(1),
6981
prior_terminal_node_expo = double(1),
7082
prior_outcome_range = double(1)
7183
) |>
7284
set_engine("dbarts") |>
7385
set_mode("regression") |>
74-
translate()
86+
translate()|>
87+
print_model_spec()
7588
```
7689

7790
```
91+
## BART Model Specification (regression)
92+
##
93+
## Main Arguments:
94+
## trees = integer(1)
95+
## prior_terminal_node_coef = double(1)
96+
## prior_terminal_node_expo = double(1)
97+
## prior_outcome_range = double(1)
98+
##
99+
## Computational engine: dbarts
78100
##
79-
## Call:
80-
## NULL
101+
## Model fit template:
102+
## dbarts::bart(x = missing_arg(), y = missing_arg(), ntree = integer(1),
103+
## base = double(1), power = double(1), k = double(1), verbose = FALSE,
104+
## keeptrees = TRUE, keepcall = FALSE)
81105
```
82106

83107
## Preprocessing requirements

tests/testthat/helper-objects.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,17 @@ if (rlang::is_installed("modeldata")) {
113113
}
114114
}
115115

116+
if (rlang::is_installed("survival")) {
117+
data(cancer, package = "survival")
118+
basic_form <- survival::Surv(time, status) ~ age
119+
complete_form <- survival::Surv(time) ~ age
120+
121+
if (R.Version()$major < "4") {
122+
data(lung, package = 'survival')
123+
} else {
124+
data(cancer, package = 'survival')
125+
}
126+
127+
basic_form <- survival::Surv(time, status) ~ group
128+
complete_form <- survival::Surv(time) ~ group
129+
}

tests/testthat/test-surv_reg_flexsurv.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
data(cancer, package = "survival")
21

3-
basic_form <- survival::Surv(time, status) ~ age
4-
complete_form <- survival::Surv(time) ~ age
52

63
# ------------------------------------------------------------------------------
74

85
test_that('flexsurv execution', {
96
skip_if_not_installed("flexsurv")
7+
skip_if_not_installed("survival")
108

119
rlang::local_options(lifecycle_verbosity = "quiet")
1210
surv_basic <- surv_reg() |> set_engine("flexsurv")
@@ -43,6 +41,8 @@ test_that('flexsurv execution', {
4341

4442
test_that('flexsurv prediction', {
4543
skip_if_not_installed("flexsurv")
44+
skip_if_not_installed("survival")
45+
4646

4747
rlang::local_options(lifecycle_verbosity = "quiet")
4848
surv_basic <- surv_reg() |> set_engine("flexsurv")

tests/testthat/test-surv_reg_survreg.R

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
if (R.Version()$major < "4") {
2-
data(lung, package = 'survival')
3-
} else {
4-
data(cancer, package = 'survival')
5-
}
61

7-
basic_form <- survival::Surv(time, status) ~ group
8-
complete_form <- survival::Surv(time) ~ group
92

103
# ------------------------------------------------------------------------------
114

0 commit comments

Comments
 (0)