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

step_lincomb() removes both columns if they are identical #1357

Open
EmilHvitfeldt opened this issue Aug 7, 2024 · 0 comments
Open

step_lincomb() removes both columns if they are identical #1357

EmilHvitfeldt opened this issue Aug 7, 2024 · 0 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@EmilHvitfeldt
Copy link
Member

EmilHvitfeldt commented Aug 7, 2024

Ideally this should only remove one of them

library(recipes)

data(ames, package = "modeldata")

ames <- ames[3]
ames$Lot_Frontage_copy <- ames$Lot_Frontage
ames
#> # A tibble: 2,930 × 2
#>    Lot_Frontage Lot_Frontage_copy
#>           <dbl>             <dbl>
#>  1          141               141
#>  2           80                80
#>  3           81                81
#>  4           93                93
#>  5           74                74
#>  6           78                78
#>  7           41                41
#>  8           43                43
#>  9           39                39
#> 10           60                60
#> # ℹ 2,920 more rows

recipe(~ ., data = ames) |>
  step_lincomb(all_numeric_predictors()) |>
  prep() |>
  bake(NULL)
#> # A tibble: 2,930 × 0

Created on 2024-08-07 with reprex v2.1.0

@EmilHvitfeldt EmilHvitfeldt added the bug an unexpected problem or unintended behavior label Aug 7, 2024
@EmilHvitfeldt EmilHvitfeldt changed the title step_lincomb() rmoves both columns if they are identical step_lincomb() removes both columns if they are identical Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant