Skip to content

Conversation

@DavisVaughan
Copy link
Member

@DavisVaughan DavisVaughan commented Jun 27, 2022

Joint PR with tidymodels/recipes#1011

We've reverted the change made in hardhat 1.0.0 that implied that non-standard role columns weren't required at forge() / bake() time. We have actually decided to take the opposite stance in recipes - i.e. we now require that all predictors and non-standard roles are present at bake() time, unless explicitly stated otherwise through update_role_requirements().

We now default to the following bake time role requirements, which matches the defaults of recipes:

default_bake_role_requirements()
#>      outcome    predictor case_weights           NA 
#>        FALSE         TRUE        FALSE         TRUE

This is essentially what pre 1.0.0 hardhat was doing (requiring all predictors, unspecified columns, and non-standard roles), with a new exception for case weights.

Additionally, we respect any changes made to these defaults through update_role_requirements().

There is full backwards compatibility with pre 1.0.0 recipes, so that hardhat can go to CRAN with these changes before recipes.

@DavisVaughan DavisVaughan force-pushed the feature/recipe-bake-requirements branch from 01d56fa to 01826e6 Compare June 27, 2022 15:08
@DavisVaughan DavisVaughan marked this pull request as ready for review June 27, 2022 18:16
@DavisVaughan DavisVaughan merged commit 1834d02 into main Jun 29, 2022
@DavisVaughan DavisVaughan deleted the feature/recipe-bake-requirements branch June 29, 2022 17:32
@DavisVaughan DavisVaughan mentioned this pull request Jun 29, 2022
4 tasks
@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants