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

spatialsample::spatial_clustering_cv() for Tidymodels -- coords removed for prediction or no? #32

Closed
PathosEthosLogos opened this issue May 31, 2022 · 5 comments

Comments

@PathosEthosLogos
Copy link

@PathosEthosLogos PathosEthosLogos commented May 31, 2022

I was just wondering if setting spatial_clustering_cv(v, coords = c(x, y) would keep x and y as predictors or would be removed (like id or strata would be).

How can I check this?

@hfrick
Copy link
Member

@hfrick hfrick commented Jun 1, 2022

I'm not entirely sure what you mean here. rsample and spatialsample do not have predictors, they only resample the data. No columns get removed. Does this answer help you?

@PathosEthosLogos
Copy link
Author

@PathosEthosLogos PathosEthosLogos commented Jun 2, 2022

I'm not entirely sure what you mean here. rsample and spatialsample do not have predictors, they only resample the data. No columns get removed. Does this answer help you?

Thanks for the reply @hfrick. Sorry it was unclear.
The scenario is:

  • set up a spatial cross validation with the two columns for the argument coords
  • set up recipe (y ~ .)
  • tune hyperparameters for elastic net (or any other algorithm)

One example I would like to cite is update_role(..., new_role = 'ID'). Once role is applied to a particular column, they are removed as predictors. I was wondering if coords argument does something similar.

@hfrick
Copy link
Member

@hfrick hfrick commented Jun 2, 2022

Ah, I see, thanks. Resampling only splits the data. The columns you declare as coords will still be part of the data and their role will be what you declare in the recipe.

@mikemahoney218
Copy link
Collaborator

@mikemahoney218 mikemahoney218 commented Jun 6, 2022

Let us know if you have further clarifications or questions 😄

@github-actions
Copy link

@github-actions github-actions bot commented Jun 21, 2022

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.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants