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

extrapolating with predict? #150

Open
cascadianaturalist opened this issue Sep 27, 2024 · 1 comment
Open

extrapolating with predict? #150

cascadianaturalist opened this issue Sep 27, 2024 · 1 comment

Comments

@cascadianaturalist
Copy link

I have a set of 30 plots of species presence-absence data that have spatial coordinates and i want to extrapolate to the grid the plots are embedded in (255 plots), when i run predict on the new data frame of 255 I get the following warning and do not know how to proceed.

Thanks!

Error in py_call_impl(callable, call_args$unnamed, call_args$named) :
IndexError: tuple index out of range
Run reticulate::py_last_error() for details.
8.
stop(structure(list(message = "IndexError: tuple index out of range\n\033[90mRun \033]8;;rstudio:run:reticulate::py_last_error()\areticulate::py_last_error()\033]8;;\a for details.\033[39m",
call = py_call_impl(callable, call_args$unnamed, call_args$named)), class = c("python.builtin.IndexError",
"python.builtin.LookupError", "python.builtin.Exception", "python.builtin.BaseException",
"python.builtin.object", "error", "condition"), py_object = ))
7.
MVP_logLik at dist_mvp.py#155
6.
pkg.env$fa$MVP_logLik(cbind(1, Y[, focal]), predictions[, c(K,
focal)], reticulate::py_to_r(object$model$get_sigma)[c(K,
focal), ], device = object$model$device, individual = TRUE,
dtype = object$model$dtype, batch_size = as.integer(object$settings$step_size), ...
5.
py_to_r_cpp(x)
4.
is_py_object(x <- py_to_r_cpp(x))
3.
reticulate::py_to_r(pkg.env$fa$MVP_logLik(cbind(1, Y[, focal]),
predictions[, c(K, focal)], reticulate::py_to_r(object$model$get_sigma)[c(K,
focal), ], device = object$model$device, individual = TRUE,
dtype = object$model$dtype, batch_size = as.integer(object$settings$step_size), ...
2.
predict.sjSDM(model, newdata = NewEnv, SP = NewCoords, Y = NewPA)
1.
predict(model, newdata = NewEnv, SP = NewCoords, Y = NewPA)

@MaximilianPi
Copy link
Member

Hi @cascadianaturalist,

could you please show your code?

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