Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RC 1.3.0 #1253

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
tensorflow::install_tensorflow(version='2.13', conda_python_version = NULL)
shell: Rscript {0}

- name: Install Torch
run: |
torch::install_torch()
shell: Rscript {0}

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}
Expand Down
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: parsnip
Title: A Common API to Modeling and Analysis Functions
Version: 1.2.1.9004
Version: 1.3.0
Authors@R: c(
person("Max", "Kuhn", , "[email protected]", role = c("aut", "cre")),
person("Davis", "Vaughan", , "[email protected]", role = "aut"),
person("Emil", "Hvitfeldt", , "[email protected]", role = "ctb"),
person("Posit Software, PBC", role = c("cph", "fnd"), comment = c(ROR = "03wc8by49"))
person("Posit Software, PBC", role = c("cph", "fnd"))
)
Maintainer: Max Kuhn <[email protected]>
Description: A common interface is provided to allow users to specify a
Expand Down Expand Up @@ -70,10 +70,10 @@ Suggests:
VignetteBuilder:
knitr
ByteCompile: true
Config/Needs/website: C50, dbarts, earth, glmnet, keras, kernlab, kknn,
LiblineaR, mgcv, nnet, parsnip, quantreg, randomForest, ranger, rpart,
rstanarm, tidymodels/tidymodels, tidyverse/tidytemplate, rstudio/reticulate,
xgboost, rmarkdown
Config/Needs/website: brulee, C50, dbarts, earth, glmnet, keras, kernlab,
kknn, LiblineaR, mgcv, nnet, parsnip, quantreg, randomForest, ranger,
rpart, rstanarm, tidymodels/tidymodels, tidyverse/tidytemplate,
rstudio/reticulate, xgboost, rmarkdown
Config/rcmdcheck/ignore-inconsequential-notes: true
Config/testthat/edition: 3
Encoding: UTF-8
Expand Down
14 changes: 7 additions & 7 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# parsnip (development version)
# parsnip 1.3.0

## New Features

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

* `fit_xy()` can now take dgCMatrix input for `x` argument (#1121).

* `fit_xy()` can now take sparse tibbles as data values (#1165).

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

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

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

* `mlp()` now has a `brulee_two_layer` engine.

## Other Changes

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

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


# parsnip 1.2.1

* Added a missing `tidy()` method for survival analysis glmnet models (#1086).
Expand Down
2 changes: 1 addition & 1 deletion inst/models.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"discrim_regularized" "classification" "klaR" "discrim"
"gen_additive_mod" "classification" "mgcv" NA
"gen_additive_mod" "regression" "mgcv" NA
"linear_reg" "quantile regression" "quantreg" NA
"linear_reg" "regression" "brulee" NA
"linear_reg" "regression" "gee" "multilevelmod"
"linear_reg" "regression" "glm" NA
Expand All @@ -55,7 +56,6 @@
"linear_reg" "regression" "lm" NA
"linear_reg" "regression" "lme" "multilevelmod"
"linear_reg" "regression" "lmer" "multilevelmod"
"linear_reg" "quantile regression" "quantreg" NA
"linear_reg" "regression" "spark" NA
"linear_reg" "regression" "stan" NA
"linear_reg" "regression" "stan_glmer" "multilevelmod"
Expand Down
8 changes: 8 additions & 0 deletions man/details_boost_tree_lightgbm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/details_decision_tree_partykit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/details_linear_reg_lme.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/details_rand_forest_aorsf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/details_rand_forest_partykit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/details_rand_forest_ranger.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/details_survival_reg_flexsurv.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/details_survival_reg_flexsurvspline.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/parsnip-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/rmd/boost_tree_lightgbm.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ To effectively enable bagging, the user would also need to set the `bagging_freq

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`.

## Sparse Data


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.

## Examples

The "Introduction to bonsai" article contains [examples](https://bonsai.tidymodels.org/articles/bonsai.html) of `boost_tree()` with the `"lightgbm"` engine.
Expand Down
6 changes: 3 additions & 3 deletions man/rmd/decision_tree_partykit.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@



For this engine, there are multiple modes: regression, classification, and censored regression
For this engine, there are multiple modes: censored regression, regression, and classification

## Tuning Parameters



This model has 2 tuning parameters:

- `min_n`: Minimal Node Size (type: integer, default: 20L)

- `tree_depth`: Tree Depth (type: integer, default: see below)

- `min_n`: Minimal Node Size (type: integer, default: 20L)

The `tree_depth` parameter defaults to `0` which means no restrictions are applied to tree depth.

An engine-specific parameter for this model is:
Expand Down
2 changes: 1 addition & 1 deletion man/rmd/linear_reg_lme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ This model can use subject-specific coefficient estimates to make predictions (i
\eta_{i} = (\beta_0 + b_{0i}) + \beta_1x_{i1}
```

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.
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.

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:

Expand Down
6 changes: 3 additions & 3 deletions man/rmd/rand_forest_aorsf.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@



For this engine, there are multiple modes: classification, regression, and censored regression
For this engine, there are multiple modes: censored regression, classification, and regression

## Tuning Parameters



This model has 3 tuning parameters:

- `mtry`: # Randomly Selected Predictors (type: integer, default: ceiling(sqrt(n_predictors)))

- `trees`: # Trees (type: integer, default: 500L)

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

- `mtry`: # Randomly Selected Predictors (type: integer, default: ceiling(sqrt(n_predictors)))

Additionally, this model has one engine-specific tuning parameter:

* `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.
Expand Down
6 changes: 3 additions & 3 deletions man/rmd/rand_forest_partykit.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@



For this engine, there are multiple modes: regression, classification, and censored regression
For this engine, there are multiple modes: censored regression, regression, and classification

## Tuning Parameters



This model has 3 tuning parameters:

- `trees`: # Trees (type: integer, default: 500L)

- `min_n`: Minimal Node Size (type: integer, default: 20L)

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

- `trees`: # Trees (type: integer, default: 500L)

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

The **bonsai** extension package is required to fit this model.
Expand Down
2 changes: 2 additions & 0 deletions man/rmd/rand_forest_ranger.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ The `fit()` and `fit_xy()` arguments have arguments called `case_weights` that e

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.

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.

## Saving fitted model objects


Expand Down
2 changes: 1 addition & 1 deletion man/rmd/survival_reg_flexsurv.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ survival_reg(dist = character(1)) %>%

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

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

```{r child = "template-survival-mean.Rmd"}
```
Expand Down
2 changes: 1 addition & 1 deletion man/rmd/survival_reg_flexsurv.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ survival_reg(dist = character(1)) %>%

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

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



Expand Down
2 changes: 1 addition & 1 deletion man/rmd/survival_reg_flexsurvspline.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ survival_reg() %>%

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

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

```{r child = "template-survival-mean.Rmd"}
```
Expand Down
2 changes: 1 addition & 1 deletion man/rmd/survival_reg_flexsurvspline.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ survival_reg() %>%

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

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



Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-fit_interfaces.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ test_that("overhead of parsnip interface is minimal (#1071)", {
skip_on_cran()
skip_on_covr()
skip_if_not_installed("bench")
skip_if_not_installed("parsnip", minimum_version = "1.3.0")
skip_if_not_installed("parsnip", minimum_version = "1.4.0")

bm <- bench::mark(
time_engine = lm(mpg ~ ., mtcars),
Expand Down
Loading
Loading