The geographical complexity of individual variables can be characterized by the differences in local attribute variables, while the common geographical complexity of multiple variables can be represented by fluctuations in the similarity of vectors composed of multiple variables. In spatial regression tasks, the goodness of fit can be improved by incorporating a geographical complexity representation vector during modeling, using a geographical complexity-weighted spatial weight matrix, or employing local geographical complexity kernel density. Similarly, in spatial sampling tasks, samples can be selected more effectively by using a method that weights based on geographical complexity. By optimizing performance in spatial regression and spatial sampling tasks, the spatial bias of the model can be effectively reduced.

Mitigating Spatial Bias Through Geographical Complexity
install.packages("geocomplexity", dep = TRUE)
install.packages('geocomplexity',
repos = c("https://ausgis.r-universe.dev",
"https://cloud.r-project.org"),
dep = TRUE)
# install.packages("devtools")
devtools::install_github("ausgis/geocomplexity",
build_vignettes = TRUE,
dep = TRUE)
Please ensure that appropriate C++ compilation environment is configured and Rcpp & RcppArmadillo is properly installed in advance if you want to install geocomplexity from source. See the next topic on C++ Settings for more information.
Windows:
Rtools.exe, keeping the default settings.Linux
Debian/Ubuntu:
apt-get update
apt-get install r-base-dev
Fedora/RedHat: should be set up already.
MacOS
Install the Xcode command line tool.
Then, in the terminal:
xcode-select --install