Skip to content

Commit 00fa075

Browse files
authored
RC 1.3.0 (#1253)
* overdue examples for brulee * namespace to anchor links * polish news * update model file * redoc * small updates * doc update * install torch
1 parent 9c477b5 commit 00fa075

25 files changed

+323
-43
lines changed

.github/workflows/pkgdown.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ jobs:
4949
tensorflow::install_tensorflow(version='2.13', conda_python_version = NULL)
5050
shell: Rscript {0}
5151

52+
- name: Install Torch
53+
run: |
54+
torch::install_torch()
55+
shell: Rscript {0}
56+
5257
- name: Build site
5358
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
5459
shell: Rscript {0}

DESCRIPTION

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Package: parsnip
22
Title: A Common API to Modeling and Analysis Functions
3-
Version: 1.2.1.9004
3+
Version: 1.3.0
44
Authors@R: c(
55
person("Max", "Kuhn", , "[email protected]", role = c("aut", "cre")),
66
person("Davis", "Vaughan", , "[email protected]", role = "aut"),
77
person("Emil", "Hvitfeldt", , "[email protected]", role = "ctb"),
8-
person("Posit Software, PBC", role = c("cph", "fnd"), comment = c(ROR = "03wc8by49"))
8+
person("Posit Software, PBC", role = c("cph", "fnd"))
99
)
1010
Maintainer: Max Kuhn <[email protected]>
1111
Description: A common interface is provided to allow users to specify a
@@ -70,10 +70,10 @@ Suggests:
7070
VignetteBuilder:
7171
knitr
7272
ByteCompile: true
73-
Config/Needs/website: C50, dbarts, earth, glmnet, keras, kernlab, kknn,
74-
LiblineaR, mgcv, nnet, parsnip, quantreg, randomForest, ranger, rpart,
75-
rstanarm, tidymodels/tidymodels, tidyverse/tidytemplate, rstudio/reticulate,
76-
xgboost, rmarkdown
73+
Config/Needs/website: brulee, C50, dbarts, earth, glmnet, keras, kernlab,
74+
kknn, LiblineaR, mgcv, nnet, parsnip, quantreg, randomForest, ranger,
75+
rpart, rstanarm, tidymodels/tidymodels, tidyverse/tidytemplate,
76+
rstudio/reticulate, xgboost, rmarkdown
7777
Config/rcmdcheck/ignore-inconsequential-notes: true
7878
Config/testthat/edition: 3
7979
Encoding: UTF-8

NEWS.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# parsnip (development version)
1+
# parsnip 1.3.0
22

33
## New Features
44

@@ -7,16 +7,17 @@
77
* Predictions are encoded via a custom vector type. See [hardhat::quantile_pred()].
88
* Predicted quantile levels are designated when the new mode is specified. See `?set_mode`.
99

10-
* `fit_xy()` can now take dgCMatrix input for `x` argument (#1121).
11-
12-
* `fit_xy()` can now take sparse tibbles as data values (#1165).
13-
14-
* `predict()` can now take dgCMatrix and sparse tibble input for `new_data` argument, and error informatively when model doesn't support it (#1167).
10+
* Updates for sparse data formats:
11+
* `fit_xy()` can now take dgCMatrix input for `x` argument (#1121).
12+
* `fit_xy()` can now take sparse tibbles as data values (#1165).
13+
* `predict()` can now take dgCMatrix and sparse tibble input for `new_data` argument, and error informatively when model doesn't support it (#1167).
1514

1615
* New `extract_fit_time()` method has been added that returns the time it took to train the model (#853).
1716

1817
* `mlp()` with `keras` engine now work for all activation functions currently supported by `keras` (#1127).
1918

19+
* `mlp()` now has a `brulee_two_layer` engine.
20+
2021
## Other Changes
2122

2223
* Transitioned package errors and warnings to use cli (#1147 and #1148 by @shum461, #1153 by @RobLBaker and @wright13, #1154 by @JamesHWade, #1160, #1161, #1081).
@@ -49,7 +50,6 @@
4950

5051
* `NULL` is no longer accepted as an engine (#1242).
5152

52-
5353
# parsnip 1.2.1
5454

5555
* Added a missing `tidy()` method for survival analysis glmnet models (#1086).

inst/models.tsv

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"discrim_regularized" "classification" "klaR" "discrim"
4545
"gen_additive_mod" "classification" "mgcv" NA
4646
"gen_additive_mod" "regression" "mgcv" NA
47+
"linear_reg" "quantile regression" "quantreg" NA
4748
"linear_reg" "regression" "brulee" NA
4849
"linear_reg" "regression" "gee" "multilevelmod"
4950
"linear_reg" "regression" "glm" NA
@@ -55,7 +56,6 @@
5556
"linear_reg" "regression" "lm" NA
5657
"linear_reg" "regression" "lme" "multilevelmod"
5758
"linear_reg" "regression" "lmer" "multilevelmod"
58-
"linear_reg" "quantile regression" "quantreg" NA
5959
"linear_reg" "regression" "spark" NA
6060
"linear_reg" "regression" "stan" NA
6161
"linear_reg" "regression" "stan_glmer" "multilevelmod"

man/details_boost_tree_lightgbm.Rd

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/details_decision_tree_partykit.Rd

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/details_linear_reg_lme.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/details_rand_forest_aorsf.Rd

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/details_rand_forest_partykit.Rd

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/details_rand_forest_ranger.Rd

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/details_survival_reg_flexsurv.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/details_survival_reg_flexsurvspline.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/parsnip-package.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/rmd/boost_tree_lightgbm.md

+5
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ To effectively enable bagging, the user would also need to set the `bagging_freq
133133

134134
bonsai quiets much of the logging output from [lightgbm::lgb.train()] by default. With default settings, logged warnings and errors will still be passed on to the user. To print out all logs during training, set `quiet = TRUE`.
135135

136+
## Sparse Data
137+
138+
139+
This model can utilize sparse data during model fitting and prediction. Both sparse matrices such as dgCMatrix from the `Matrix` package and sparse tibbles from the `sparsevctrs` package are supported. See [sparse_data] for more information.
140+
136141
## Examples
137142

138143
The "Introduction to bonsai" article contains [examples](https://bonsai.tidymodels.org/articles/bonsai.html) of `boost_tree()` with the `"lightgbm"` engine.

man/rmd/decision_tree_partykit.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11

22

33

4-
For this engine, there are multiple modes: regression, classification, and censored regression
4+
For this engine, there are multiple modes: censored regression, regression, and classification
55

66
## Tuning Parameters
77

88

99

1010
This model has 2 tuning parameters:
1111

12-
- `min_n`: Minimal Node Size (type: integer, default: 20L)
13-
1412
- `tree_depth`: Tree Depth (type: integer, default: see below)
1513

14+
- `min_n`: Minimal Node Size (type: integer, default: 20L)
15+
1616
The `tree_depth` parameter defaults to `0` which means no restrictions are applied to tree depth.
1717

1818
An engine-specific parameter for this model is:

man/rmd/linear_reg_lme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This model can use subject-specific coefficient estimates to make predictions (i
3939
\eta_{i} = (\beta_0 + b_{0i}) + \beta_1x_{i1}
4040
```
4141

42-
where $i$ denotes the `i`th independent experimental unit (e.g. subject). When the model has seen subject `i`, it can use that subject's data to adjust the _population_ intercept to be more specific to that subjects results.
42+
where `i` denotes the `i`th independent experimental unit (e.g. subject). When the model has seen subject `i`, it can use that subject's data to adjust the _population_ intercept to be more specific to that subjects results.
4343

4444
What happens when data are being predicted for a subject that was not used in the model fit? In that case, this package uses _only_ the population parameter estimates for prediction:
4545

man/rmd/rand_forest_aorsf.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11

22

33

4-
For this engine, there are multiple modes: classification, regression, and censored regression
4+
For this engine, there are multiple modes: censored regression, classification, and regression
55

66
## Tuning Parameters
77

88

99

1010
This model has 3 tuning parameters:
1111

12-
- `mtry`: # Randomly Selected Predictors (type: integer, default: ceiling(sqrt(n_predictors)))
13-
1412
- `trees`: # Trees (type: integer, default: 500L)
1513

1614
- `min_n`: Minimal Node Size (type: integer, default: 5L)
1715

16+
- `mtry`: # Randomly Selected Predictors (type: integer, default: ceiling(sqrt(n_predictors)))
17+
1818
Additionally, this model has one engine-specific tuning parameter:
1919

2020
* `split_min_stat`: Minimum test statistic required to split a node. Defaults are `3.841459` for censored regression (which is roughly a p-value of 0.05) and `0` for classification and regression. For classification, this tuning parameter should be between 0 and 1, and for regression it should be greater than or equal to 0. Higher values of this parameter cause trees grown by `aorsf` to have less depth.

man/rmd/rand_forest_partykit.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11

22

33

4-
For this engine, there are multiple modes: regression, classification, and censored regression
4+
For this engine, there are multiple modes: censored regression, regression, and classification
55

66
## Tuning Parameters
77

88

99

1010
This model has 3 tuning parameters:
1111

12+
- `trees`: # Trees (type: integer, default: 500L)
13+
1214
- `min_n`: Minimal Node Size (type: integer, default: 20L)
1315

1416
- `mtry`: # Randomly Selected Predictors (type: integer, default: 5L)
1517

16-
- `trees`: # Trees (type: integer, default: 500L)
17-
1818
## Translation from parsnip to the original package (regression)
1919

2020
The **bonsai** extension package is required to fit this model.

man/rmd/rand_forest_ranger.md

+2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ The `fit()` and `fit_xy()` arguments have arguments called `case_weights` that e
108108

109109
This model can utilize sparse data during model fitting and prediction. Both sparse matrices such as dgCMatrix from the `Matrix` package and sparse tibbles from the `sparsevctrs` package are supported. See [sparse_data] for more information.
110110

111+
While this engine supports sparse data as an input, it doesn't use it any differently than dense data. Hence there it no reason to convert back and forth.
112+
111113
## Saving fitted model objects
112114

113115

man/rmd/survival_reg_flexsurv.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ survival_reg(dist = character(1)) %>%
4040

4141
The main interface for this model uses the formula method since the model specification typically involved the use of [survival::Surv()].
4242

43-
For this engine, stratification cannot be specified via [`strata()`], please see [flexsurv::flexsurvreg()] for alternative specifications.
43+
For this engine, stratification cannot be specified via [`survival::strata()`], please see [flexsurv::flexsurvreg()] for alternative specifications.
4444

4545
```{r child = "template-survival-mean.Rmd"}
4646
```

man/rmd/survival_reg_flexsurv.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ survival_reg(dist = character(1)) %>%
4242

4343
The main interface for this model uses the formula method since the model specification typically involved the use of [survival::Surv()].
4444

45-
For this engine, stratification cannot be specified via [`strata()`], please see [flexsurv::flexsurvreg()] for alternative specifications.
45+
For this engine, stratification cannot be specified via [`survival::strata()`], please see [flexsurv::flexsurvreg()] for alternative specifications.
4646

4747

4848

man/rmd/survival_reg_flexsurvspline.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ survival_reg() %>%
2626

2727
The main interface for this model uses the formula method since the model specification typically involved the use of [survival::Surv()].
2828

29-
For this engine, stratification cannot be specified via [`strata()`], please see [flexsurv::flexsurvspline()] for alternative specifications.
29+
For this engine, stratification cannot be specified via [`survival::strata()`], please see [flexsurv::flexsurvspline()] for alternative specifications.
3030

3131
```{r child = "template-survival-mean.Rmd"}
3232
```

man/rmd/survival_reg_flexsurvspline.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ survival_reg() %>%
3737

3838
The main interface for this model uses the formula method since the model specification typically involved the use of [survival::Surv()].
3939

40-
For this engine, stratification cannot be specified via [`strata()`], please see [flexsurv::flexsurvspline()] for alternative specifications.
40+
For this engine, stratification cannot be specified via [`survival::strata()`], please see [flexsurv::flexsurvspline()] for alternative specifications.
4141

4242

4343

tests/testthat/test-fit_interfaces.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ test_that("overhead of parsnip interface is minimal (#1071)", {
156156
skip_on_cran()
157157
skip_on_covr()
158158
skip_if_not_installed("bench")
159-
skip_if_not_installed("parsnip", minimum_version = "1.3.0")
159+
skip_if_not_installed("parsnip", minimum_version = "1.4.0")
160160

161161
bm <- bench::mark(
162162
time_engine = lm(mpg ~ ., mtcars),

0 commit comments

Comments
 (0)