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

Functionality to support users with modelr::data_grid into newdata #280

Open
athowes opened this issue Sep 4, 2024 · 5 comments
Open

Functionality to support users with modelr::data_grid into newdata #280

athowes opened this issue Sep 4, 2024 · 5 comments

Comments

@athowes
Copy link
Collaborator

athowes commented Sep 4, 2024

The workflow (see #52) we have for creating newdata (that goes into tidybayes) is:

newdata_sex <- obs_prep |>
  as.data.frame() |>
  modelr::data_grid(sex) |>
  mutate(obs_t = NA, pwindow_upr = NA, swindow_upr = NA)

Perhaps we want to support users to do this somehow?

Maybe just the mutation part? It could have options to specify e.g. "no censoring" or "no truncation" rather than having to know what to do yourself? (But also we should make it more obvious via the names.)

@athowes athowes added the medium label Sep 4, 2024
@athowes athowes mentioned this issue Sep 4, 2024
9 tasks
@seabbs
Copy link
Contributor

seabbs commented Sep 4, 2024

I think ideally it would dispatch on the class of the model people have used

@seabbs
Copy link
Contributor

seabbs commented Sep 4, 2024

I also would be surprised if that as.data.frame was actually needed?

@athowes
Copy link
Collaborator Author

athowes commented Sep 4, 2024

I also would be surprised if that as.data.frame was actually needed?

I think it's needed currently but I don't think that it should be needed.

@athowes
Copy link
Collaborator Author

athowes commented Sep 4, 2024

I think ideally it would dispatch on the class of the model people have used

Yes I agree. Given that the parts that are required are the LHS of the formula which are model specific. It could be that in future we allow users to "predict without censoring" using a different model in a different way than by setting window variables to zero.

@athowes
Copy link
Collaborator Author

athowes commented Jan 29, 2025

Flagging that I'm using these code snippets, and I think would be good to have this as feature in the package (with dispatch on model class).

@seabbs seabbs removed the medium label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants