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

Supply a data.frame or sparse matrix as predictor #136

Open
3 tasks done
Martin-Jung opened this issue Jan 31, 2025 · 0 comments
Open
3 tasks done

Supply a data.frame or sparse matrix as predictor #136

Martin-Jung opened this issue Jan 31, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request Quality of life Quality of life improvement

Comments

@Martin-Jung
Copy link
Collaborator

Martin-Jung commented Jan 31, 2025

When creating a model, predictors can be added via add_predictors . Currently this function supports only SpatRaster (and eventually stars) objects, but a case can be made that for very large predictors (talking several GBs), it is more efficient to directly supply the extracted covariates (which could also be prepared in any other way).

  • Reason is that internally predictors are extracted and saved as data.frame for projection, which however is inefficient for large Raster layers.

  • The alternative would be to supply an already extracted data.frame with predictors.

  • Predictions in that case will be conducted only with inference_only=TRUE setting in train(). Spatial predictions can then be done via scenario() |> add_predictors() |> project().

  • This way also tile predictors could be supplied, thus allowing for better parallization

  • Allow data.frames to be supplied to add_predictors

  • Check that projections and training work

  • Add unit test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Quality of life Quality of life improvement
Projects
None yet
Development

No branches or pull requests

1 participant