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.1.0 #1342

Merged
merged 10 commits into from
Jul 5, 2024
Merged
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
6 changes: 2 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: recipes
Title: Preprocessing and Feature Engineering Steps for Modeling
Version: 1.0.10.9000
Version: 1.1.0
Authors@R: c(
person("Max", "Kuhn", , "[email protected]", role = c("aut", "cre")),
person("Hadley", "Wickham", , "[email protected]", role = "aut"),
Expand All @@ -26,7 +26,7 @@ Imports:
generics (>= 0.1.2),
glue,
gower,
hardhat (>= 1.3.1.9000),
hardhat (>= 1.4.0),
ipred (>= 0.9-12),
lifecycle (>= 1.0.3),
lubridate (>= 1.8.0),
Expand Down Expand Up @@ -71,5 +71,3 @@ Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
Remotes:
tidymodels/hardhat
46 changes: 27 additions & 19 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,54 @@
# recipes (development version)
# recipes 1.1.0

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

* `step_spline_b()`, `step_spline_convex()`, `step_spline_monotone()`, and `step_spline_nonnegative()` now throws informative errors if the`degree`, `deg_free`, and `complete_set` arguments causes an error. (#1170)
* Improved error message for misspelled argument in step functions. (#1318)

* Developer helper function `recipes_ptype()` has been added, returning expected input data for `prep()` and `bake()` for a given recipe object. (#1329)
* `recipe()` can now take data.frames with list-columns or sf data.frames as input to `data`. (#1283)

* Developer helper function `recipes_ptype_validate()` has been added, to validate new data is compatible with recipe ptype. (#793)
* `recipe()` will now show better error when columns are misspelled in formula (#1283).

* The `prefix` argument of `step_dummy_multi_choice()` is not properly documented. (#1298)
* `add_role()` now errors if a column would simultaneously have roles `"outcome"` and `"predictor"`. (#935)

* `step_dummy()` now gives an informative error on attempt to generate too many columns to fit in memory. (#828)
* `prep()` will now error if the ptype of the data doesn't match which was used to define the recipe. (#793)

* `NA` levels in factors aren't dropped when passed to `recipe()`. (#1291)
* Added more documentation in `?selections` about how `tidyselect::everything()` works in recipes. (#1259)

* `recipe()` no longer crashes when given long formula expression (#1283).
* New `extract_fit_time()` method has been added that returns the time it took to train the recipe. (#1071)

* `step_interact()` now gives better error if `terms` isn't a formula. (#1299)
* `step_spline_b()`, `step_spline_convex()`, `step_spline_monotone()`, and `step_spline_nonnegative()` now throws informative errors if the`degree`, `deg_free`, and `complete_set` arguments causes an error. (#1170)

* `recipe()` will now show better error when columns are misspelled in formula (#1283).
* `step_mutate()` gained `.pkgs` argument to specify what packages need to be loaded for step to work. (#1282)

* Fixed bug in `step_ns()` and `step_bs()` where `knots` field in `options` argument wasn't correctly used. (#1297)
* `step_interact()` now gives better error if `terms` isn't a formula. (#1299)

* `add_role()` now errors if a column would simultaneously have roles `"outcome"` and `"predictor"`. (#935)
* The `prefix` argument of `step_dummy_multi_choice()` is now properly documented. (#1298)

* Significant speedup in `step_dummy()` when applied to many columns. (#1305)

* Bug fixed in `step_interact()` where long formulas were used. (#1231, #1289)

* `recipe()` can now take data.frames with list-columns or sf data.frames as input to `data`. (#1283)
* `step_dummy()` now gives an informative error on attempt to generate too many columns to fit in memory. (#828)

* `step_dummy()` and `step_unknown()` now throw more informative warnings for unseen levels. (#450)

* `step_dummy()` now throws more informative warnings for `NA` values. (#450)

## Bug Fixes

* `NA` levels in factors aren't dropped when passed to `recipe()`. (#1291)

* `recipe()` no longer crashes when given long formula expression (#1283).

* Fixed bug in `step_ns()` and `step_bs()` where `knots` field in `options` argument wasn't correctly used. (#1297)

* Bug fixed in `step_interact()` where long formulas were used. (#1231, #1289)

* Fixed documentation mistake where default value of `keep_original_cols` argument were wrong. (#1314)

* `step_mutate()` gained `.pkgs` argument to specify what packages need to be loaded for step to work. (#1282)
## Developer

* Added more documentation in `?selections` about how `tidyselect::everything()` works in recipes. (#1259)
* Developer helper function `recipes_ptype()` has been added, returning expected input data for `prep()` and `bake()` for a given recipe object. (#1329)

* Improved error message for misspelled argument in step functions. (#1318)
* Developer helper function `recipes_ptype_validate()` has been added, to validate new data is compatible with recipe ptype. (#793)

* Developer helper functions `recipes_names_predictors()` and `recipes_names_outcomes()` have been added to aid variable selection in steps. (#1026)

Expand Down
25 changes: 19 additions & 6 deletions R/ptype.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#' with `update_role_requirements()`, and `recipes_ptype()` respects those
#' changes.
#'
#' `recipes_ptype()` returns `NULL` on recipes created prior to version 1.1.0.
#'
#' Note that the order of the columns aren't guaranteed to align with
#' `data_ptype` as the data internally is ordered according to roles.
#'
Expand Down Expand Up @@ -84,13 +86,9 @@
recipes_ptype <- function(x, ..., stage = "prep") {
check_dots_empty0(...)

# recipe created prior to 1.1.0
if (is.null(x$ptype)) {
cli::cli_abort(
c(
x = "Doesn't work on recipes created prior to version 1.1.0.",
i = "Please recreate recipe."
)
)
return(NULL)
}

ptype <- x$ptype
Expand All @@ -112,6 +110,15 @@ recipes_ptype <- function(x, ..., stage = "prep") {
ptype
}


long_function_name <- function(x,
...,
verbose = FALSE) {
x
}



#' Validate prototype of recipe object
#'
#' This helper function validates a dataframe against the ptype of a recipe.
Expand Down Expand Up @@ -143,6 +150,12 @@ recipes_ptype_validate <- function(x,
stage = "prep",
call = rlang::caller_env()) {
old_ptype <- recipes_ptype(x, stage = stage)

# recipe created prior to 1.1.0
if (is.null(old_ptype)) {
return(invisible())
}

col_names <- names(old_ptype)

new_ptype <- vctrs::vec_ptype(new_data)
Expand Down
2 changes: 1 addition & 1 deletion R/recipe.R
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ bake <- function(object, ...) {
#' @param ... One or more selector functions to choose which variables will be
#' returned by the function. See [selections()] for more details.
#' If no selectors are given, the default is to use
#' [everything()].
#' [dplyr::everything()].
#' @param composition Either "tibble", "matrix", "data.frame", or
#' "dgCMatrix" for the format of the processed data set. Note that
#' all computations during the baking process are done in a
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pak::pak("tidymodels/recipes")

## Contributing

- For questions and discussions about tidymodels packages, modeling, and machine learning, please [post on RStudio Community](https://community.rstudio.com/c/ml/15).
- For questions and discussions about tidymodels packages, modeling, and machine learning, please [post on RStudio Community](https://forum.posit.co/c/ml/15).

- If you think you have encountered a bug, please [submit an issue](https://github.com/tidymodels/recipes/issues).

Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ pak::pak("tidymodels/recipes")

## Contributing

- For questions and discussions about tidymodels packages, modeling,
and machine learning, please [post on RStudio
Community](https://community.rstudio.com/c/ml/15).
- For questions and discussions about tidymodels packages, modeling, and
machine learning, please [post on RStudio
Community](https://forum.posit.co/c/ml/15).

- If you think you have encountered a bug, please [submit an
issue](https://github.com/tidymodels/recipes/issues).
- If you think you have encountered a bug, please [submit an
issue](https://github.com/tidymodels/recipes/issues).

- Either way, learn how to create and share a
[reprex](https://reprex.tidyverse.org/articles/articles/learn-reprex.html)
(a minimal, reproducible example), to clearly communicate about your
code.
- Either way, learn how to create and share a
[reprex](https://reprex.tidyverse.org/articles/articles/learn-reprex.html)
(a minimal, reproducible example), to clearly communicate about your
code.

- Check out further details on [contributing guidelines for tidymodels
packages](https://www.tidymodels.org/contribute/) and [how to get
help](https://www.tidymodels.org/help/).
- Check out further details on [contributing guidelines for tidymodels
packages](https://www.tidymodels.org/contribute/) and [how to get
help](https://www.tidymodels.org/help/).
2 changes: 1 addition & 1 deletion man/bake.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/juice.Rd

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

4 changes: 2 additions & 2 deletions man/recipe.Rd

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

2 changes: 2 additions & 0 deletions man/recipes_ptype.Rd

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

18 changes: 9 additions & 9 deletions man/selections.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/step_bs.Rd

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

68 changes: 15 additions & 53 deletions revdep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,22 @@

|field |value |
|:--------|:-----------------------------------|
|version |R version 4.3.2 (2023-10-31) |
|os |macOS Sonoma 14.2.1 |
|version |R version 4.4.0 (2024-04-24) |
|os |macOS Sonoma 14.4.1 |
|system |aarch64, darwin20 |
|ui |RStudio |
|ui |X11 |
|language |(EN) |
|collate |en_US.UTF-8 |
|ctype |en_US.UTF-8 |
|tz |America/Los_Angeles |
|date |2024-02-16 |
|rstudio |2023.12.0+359 Ocean Storm (desktop) |
|date |2024-06-10 |
|pandoc |2.17.1.1 @ /opt/homebrew/bin/pandoc |

# Dependencies

|package |old |new |Δ |
|:------------|:----------|:----------|:--|
|recipes |1.0.9 |1.0.9.9000 |* |
|cli |3.6.2 |3.6.2 | |
|clock |0.7.0 |0.7.0 | |
|cpp11 |0.4.7 |0.4.7 | |
|data.table |1.15.0 |1.15.0 | |
|diagram |1.6.5 |1.6.5 | |
|digest |0.6.34 |0.6.34 | |
|dplyr |1.1.4 |1.1.4 | |
|ellipsis |0.3.2 |0.3.2 | |
|fansi |1.0.6 |1.0.6 | |
|future |1.33.1 |1.33.1 | |
|future.apply |1.11.1 |1.11.1 | |
|generics |0.1.3 |0.1.3 | |
|globals |0.16.2 |0.16.2 | |
|glue |1.7.0 |1.7.0 | |
|gower |1.0.1 |1.0.1 | |
|hardhat |1.3.1 |1.3.1 | |
|ipred |0.9-14 |0.9-14 | |
|lava |1.7.3 |1.7.3 | |
|lifecycle |1.0.4 |1.0.4 | |
|listenv |0.9.1 |0.9.1 | |
|lubridate |1.9.3 |1.9.3 | |
|magrittr |2.0.3 |2.0.3 | |
|numDeriv |2016.8-1.1 |2016.8-1.1 | |
|parallelly |1.36.0 |1.36.0 | |
|pillar |1.9.0 |1.9.0 | |
|pkgconfig |2.0.3 |2.0.3 | |
|prodlim |2023.08.28 |2023.08.28 | |
|progressr |0.14.0 |0.14.0 | |
|purrr |1.0.2 |1.0.2 | |
|R6 |2.5.1 |2.5.1 | |
|Rcpp |1.0.12 |1.0.12 | |
|rlang |1.1.3 |1.1.3 | |
|shape |1.4.6 |1.4.6 | |
|SQUAREM |2021.1 |2021.1 | |
|stringi |1.8.3 |1.8.3 | |
|stringr |1.5.1 |1.5.1 | |
|tibble |3.2.1 |3.2.1 | |
|tidyr |1.3.1 |1.3.1 | |
|tidyselect |1.2.0 |1.2.0 | |
|timechange |0.3.0 |0.3.0 | |
|timeDate |4032.109 |4032.109 | |
|tzdb |0.4.0 |0.4.0 | |
|utf8 |1.2.4 |1.2.4 | |
|vctrs |0.6.5 |0.6.5 | |
|withr |3.0.0 |3.0.0 | |
|package |old |new |Δ |
|:-------|:------|:-----------|:--|
|recipes |1.0.10 |1.0.10.9000 |* |

# Revdeps

Expand All @@ -74,3 +28,11 @@
|D2MCS |1.0.1 |1 | | |
|hydrorecipes |0.0.3 |1 | | |

## New problems (3)

|package |version |error |warning |note |
|:-----------|:-------|:------|:-------|:----|
|[tidybins](problems.md#tidybins)|0.1.0 |__+1__ | |2 |
|[tidysdm](problems.md#tidysdm)|0.9.4 |__+1__ | | |
|[viraldomain](problems.md#viraldomain)|0.0.3 |__+2__ | | |

15 changes: 14 additions & 1 deletion revdep/cran.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@

We checked 71 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.

* We saw 0 new problems
* We saw 3 new problems
* We failed to check 2 packages

Issues with CRAN packages are summarised below.

### New problems
(This reports the first line of each new failure)

* tidybins
checking examples ... ERROR

* tidysdm
checking tests ...

* viraldomain
checking examples ... ERROR
checking tests ...

### Failed to check

* D2MCS (NA)
Expand Down
Loading
Loading