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

Steps idea: Dealing with correlation #206

Open
EmilHvitfeldt opened this issue Oct 1, 2023 · 0 comments
Open

Steps idea: Dealing with correlation #206

EmilHvitfeldt opened this issue Oct 1, 2023 · 0 comments
Labels
feature a feature request or enhancement

Comments

@EmilHvitfeldt
Copy link
Member

EmilHvitfeldt commented Oct 1, 2023

  1. find the correlation structure
  2. find groups of highly correlated features
  3. replace each group with the PC of just those features
  4. profit

look at correlation filter

library(tidymodels)
spline_cols <- ames |>
select(where(function(x) n_distinct(x) > 1000 && is.numeric(x))) |>
names()
recipe(~., data = ames) |>
step_rm(all_nominal_predictors()) |>
step_spline_natural(any_of(spline_cols), deg_free = 10) |>
prep() |>
bake(NULL) |>
corrr::correlate() |>
autoplot(method = "identity")

library(tidymodels)
spline_cols <- ames |>
select(where(function(x) n_distinct(x) > 1000 && is.numeric(x)))
recipe(~., data = spline_cols) |>
step_pca(all_predictors(), threshold = 1) |>
step_spline_natural(all_predictors(), deg_free = 10) |>
prep() |>
bake(NULL) |>
corrr::correlate() |>
autoplot(method = "identity")
@EmilHvitfeldt EmilHvitfeldt added the feature a feature request or enhancement label Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant