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

Add check to prevent a variable to be outcome and predictor at the same time #935

Closed
EmilHvitfeldt opened this issue Mar 17, 2022 · 1 comment · Fixed by #1321
Closed
Assignees
Labels
feature a feature request or enhancement

Comments

@EmilHvitfeldt
Copy link
Member

There are no checks in add_role() right now, and the following is possible.

library(recipes)

recipe(mpg ~., data = mtcars) %>%
  add_role("mpg", new_role = "predictor")
#> Recipe
#> 
#> Inputs:
#> 
#>       role #variables
#>    outcome          1
#>  predictor         11

This feels like a pattern that shouldn't be possible and would almost always be a mistake.

Copy link

This issue 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 Jun 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant