Skip to contents

Function for determining the best parameter for the geosom model

Usage

geosom_bestparam(
  data,
  coords,
  wt,
  xdim,
  ydim,
  topo = c("rectangular", "hexagonal"),
  neighbourhood.fct = c("bubble", "gaussian"),
  cores = 1,
  ...
)

Arguments

data

A data.frame or tibble

coords

The coordinate column name in the data.

wt

The weight vector of spatial coordination.

xdim

X dimensions of the grid, a numeric vector.

ydim

Y dimensions of the grid, a numeric vector.

topo

(optional) Default use hexagonal and rectangular.

neighbourhood.fct

(optional) Default use bubble and gaussian neighbourhoods together when training a GeoSOM model.

cores

positive integer(default is 1). If cores > 1, a 'parallel' package cluster with that many cores is created and used. You can also supply a cluster object.

...

(optional) Other arguments passed to geosom().

Value

A list with the optimal parameter in the provided parameter combination and the corresponding error.

Author

Wenbo Lv lyu.geosocial@gmail.com

Examples

if (FALSE) {
data(pmc)
set.seed(2004)
geosom_bestparam(data = pmc, coords = c("centroidx","centroidy"),
wt = seq(0.1,5,by = 0.1),xdim = 3:10, ydim = 3:10,cores = 6)
}