Skip to content

scaling steps should warn if NaN is returned #1221

Closed

Description

@EmilHvitfeldt

Max Approved

library(recipes)

recipe(mpg ~ ., data = mtcars) |>
  step_log(vs) |>
  step_scale(all_predictors()) |>
  prep() |>
  bake(new_data = NULL)
#> # A tibble: 32 × 11
#>      cyl  disp    hp  drat    wt  qsec    vs    am  gear  carb   mpg
#>    <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#>  1  3.36 1.29  1.60   7.29  2.68  9.21   NaN  2.00  5.42 2.48   21  
#>  2  3.36 1.29  1.60   7.29  2.94  9.52   NaN  2.00  5.42 2.48   21  
#>  3  2.24 0.871 1.36   7.20  2.37 10.4    NaN  2.00  5.42 0.619  22.8
#>  4  3.36 2.08  1.60   5.76  3.29 10.9    NaN  0     4.07 0.619  21.4
#>  5  4.48 2.90  2.55   5.89  3.52  9.52   NaN  0     4.07 1.24   18.7
#>  6  3.36 1.82  1.53   5.16  3.54 11.3    NaN  0     4.07 0.619  18.1
#>  7  4.48 2.90  3.57   6.00  3.65  8.86   NaN  0     4.07 2.48   14.3
#>  8  2.24 1.18  0.904  6.90  3.26 11.2    NaN  0     5.42 1.24   24.4
#>  9  2.24 1.14  1.39   7.33  3.22 12.8    NaN  0     5.42 1.24   22.8
#> 10  3.36 1.35  1.79   7.33  3.52 10.2    NaN  0     5.42 2.48   19.2
#> # ℹ 22 more rows

Activity

  1. github-actions commented on Dec 1, 2023

    @github-actions
    Contributor

    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.

  2. locked and limited conversation to collaborators on Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancementgood first issue ❤️good issue for first-time contributors

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions