tidymodels/recipes

step_lincomb() removes both columns if they are identical

Opened this issue · 0 comments

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