-
Notifications
You must be signed in to change notification settings - Fork 111
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 warning message when scaling steps return NaN #1252
Add warning message when scaling steps return NaN #1252
Conversation
add scaling steps warning test change test and warning text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @mastoffel 👋 thanks for taking on this work!!
Good work so far!
There are a few other places where we need warnings such as in step_range()
library(recipes)
recipe(~., data = data.frame(x = rep(1, 10))) |>
step_range(x) |>
prep() |>
bake(NULL)
#> # A tibble: 10 × 1
#> x
#> <dbl>
#> 1 NaN
#> 2 NaN
#> 3 NaN
#> 4 NaN
#> 5 NaN
#> 6 NaN
#> 7 NaN
#> 8 NaN
#> 9 NaN
#> 10 NaN
or in step_center()
if Inf
is passed in
library(recipes)
recipe(~., data = data.frame(x = rep(0, 10))) |>
step_log(x) |>
step_center(x) |>
prep() |>
bake(NULL)
#> # A tibble: 10 × 1
#> x
#> <dbl>
#> 1 NaN
#> 2 NaN
#> 3 NaN
#> 4 NaN
#> 5 NaN
#> 6 NaN
#> 7 NaN
#> 8 NaN
#> 9 NaN
#> 10 NaN
If you are not up for those other checks we can change it so it references the issues instead of closing it.
also, please add a bullet in the NEWS file as well. giving yourself credit
Thanks a lot for the detailed comments @EmilHvitfeldt ! I've added warnings to |
Thanks for all the help @mastoffel !! if there are any other issues you want to work on, message in them and we will see what we can do! |
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. |
Adds warning when
step_scale()
returns NaN columns due toInf
orna_rm=False
Closes #1221