Build a self-organizing map
SOM(
data,
xdim = 10,
ydim = 10,
zdim = NULL,
batch = F,
rlen = 10,
alphaA = c(0.05, 0.01),
radiusA = stats::quantile(nhbrdist, 0.67) * c(1, 0),
alphaB = alphaA * c(-negAlpha, -0.1 * negAlpha),
radiusB = negRadius * radiusA,
negRadius = 1.33,
negAlpha = 0.1,
epochRadii = seq(radiusA[1], radiusA[2], length.out = rlen),
init = FALSE,
initf = Initialize_PCA,
distf = 2,
codes = NULL,
importance = NULL,
coordsFn = NULL,
nhbr.method = "maximum",
noMapping = F,
parallel = F,
threads = if (parallel) 0 else 1
)
A map useful for embedding (EmbedSOM()
function) or further analysis, e.g. clustering.
Matrix containing the training data
Width of the grid
Hight of the grid
Depth of the grid, causes the grid to be 3D if set
Use batch training (default FALSE
chooses online training, which is more like FlowSOM)
Number of training epochs; or number of times to loop over the training data in online training
Start and end learning rate for online learning (only for online training)
Start and end radius
Start and end learning rate for the second radius (only for online training)
Start and end radius (only for online training; make sure it is larger than radiusA)
easy way to set radiusB as a multiple of default radius (use lower value for higher dimensions)
the same for alphaB
Vector of length rlen
with precise epoch radii (only for batch training)
Initialize cluster centers in a non-random way
Use the given initialization function if init==T (default: Initialize_PCA)
Distance function (1=manhattan, 2=euclidean, 3=chebyshev, 4=cosine)
Cluster centers to start with
array with numeric values. Columns of data
will be scaled according to importance.
Function to generate/transform grid coordinates (e.g. tSNECoords()
). If NULL
(default), the grid is the canonical SOM grid.
Way of computing grid distances, passed as method=
to stats::dist()
function. Defaults to maximum
(square neighborhoods); use euclidean
for round neighborhoods.
If TRUE, do not compute the mapping (default FALSE). Makes the process quicker by 1 rlen
.
Parallelize the batch training by setting appropriate threads
. Defaults to FALSE. Always use batch=TRUE
for fully parallelized version, online training is not parallelizable. Passed to MapDataToCodes()
.
Number of threads of the batch training (has no effect on online training). Defaults to 0 (chooses maximum available hardware threads) if parallel==TRUE
or 1 (single thread) if parallel==FALSE
. Passed to MapDataToCodes()
.
FlowSOM::SOM