In general you may not be able to figure this out. For example, if you create dummy variables, then PCA components, then other steps, you probably could not trace them.
For step_dummy()
, you can though via the tidy()
method:
library(tidymodels)
#> Registered S3 method overwritten by 'tune':
#> method from
#> required_pkgs.model_spec parsnip
data(attrition)
rec <-
recipe(Attrition ~ ., data = attrition) %>%
step_normalize(all_numeric_predictors()) %>%
step_dummy(all_nominal_predictors())
prepped <- prep(rec)
tidy(prepped, number = 2)
#> # A tibble: 43 × 3
#> terms columns id
#> <chr> <chr> <chr>
#> 1 BusinessTravel Travel_Frequently dummy_4GB6U
#> 2 BusinessTravel Travel_Rarely dummy_4GB6U
#> 3 Department Research_Development dummy_4GB6U
#> 4 Department Sales dummy_4GB6U
#> 5 Education College dummy_4GB6U
#> 6 Education Bachelor dummy_4GB6U
#> 7 Education Master dummy_4GB6U
#> 8 Education Doctor dummy_4GB6U
#> 9 EducationField Life_Sciences dummy_4GB6U
#> 10 EducationField Marketing dummy_4GB6U
#> # … with 33 more rows
Created on 2021-11-08 by the reprex package (v2.0.0)