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

Attempting to predict using MERF object on test dataset #5

Open
christopherDennison opened this issue Nov 14, 2024 · 0 comments
Open

Comments

@christopherDennison
Copy link

Good evening,

I have been using LongituRF to run mixed-effects random forest models, and have a question RE the predict.longituRF() function.

I have created a MERF using training data (n = 222), and want to use this model fit to predict on a subset (test data, n = 75). However, when I use the code:

predictions_merf_df <-
predict(
object = MERF_bird_Shannon,
X = data.frame(Test_list$X),
id = Test_list$id,
Z = Test_list$Z,
time = Test_list$time)

I receive the error:
Error in Ypred[w] <- f[w] + Z[w, , drop = FALSE] %*% object$random_effects[k, :
replacement has length zero

I understand this is likely not an issue with the LongituRF package itself, but perhaps something I am doing wrong on my end. I thought this would be the best place to raise the question, regardless.

Thank you so much for your time.

  • Chris
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

1 participant