Train a PAI Model
train_pai_model.Rd
Trains a supervised learning or analytical model to define a spatial transformation.
Arguments
- gcp_data
An
sf
object of homologous points fromread_gcps()
.- method
A character string specifying the algorithm. One of: "lm","tps", "gam", "rf", or "helmert".
- seed
An integer for setting the random seed for reproducibility.
- ...
Additional arguments passed to the underlying model fitting functions (
mgcv::gam
,stats::lm
,ranger::ranger
,fields::Tps
).
Details
This function serves as a factory for creating transformation models. It supports machine learning methods ("lm", "gam", "rf") that learn the relationship between source coordinates and displacement vectors, as well as the analytical "helmert" method which solves for a global similarity transformation.
Important: The more flexible machine learning models, gam
and rf
,
require a sufficient number of data points to produce stable and reliable
results. This function will prevent training these models with fewer than
60 homologous points to avoid overfitting. If you have a small number of
points, please use the more robust "lm" or "helmert" methods.