som.nn.do.train: Work hourse for hexagonal som training

View source: R/som.nn.do.train.R

som.nn.do.trainR Documentation

Work hourse for hexagonal som training

Description

The function is called by som.nn.train and som.nn.continue to train self-organising map with hexagonal tolology.

Usage

som.nn.do.train(
  x,
  class.idx,
  kernel = "internal",
  xdim,
  ydim,
  toroidal,
  len,
  alpha,
  radius = 0,
  norm,
  norm.center,
  norm.scale,
  dist.fun,
  max.dist,
  strict,
  name,
  continue,
  len.total,
  codes = NULL
)

Arguments

x

data.fame with training data. Samples are requested as rows and taken randomly for the training steps. All columns except of the class lables are considered to be attributes and parts of the training vector. One column is needed as class labels. The column with class lables is selected by the argument class.col. If class is not given, the first column is used as class labels.

class.idx

index of the column with as class labels (after beeing coerced to character).

kernel

kernel to be used for training.

xdim

dimension in x-direction.

ydim

dimension in y-direction.

toroidal

logical; if TRUE an endless som is trained as on the surface of a torus.

len

number of steps to be trained (steps - not epochs!).

alpha

initial training rate.

radius

inital radius for SOM training. Gaussian distance function is used, radius corresponds to sigma.

norm

logical; if TRUE, input data is normalised with scale(x, TRUE, TRUE).

dist.fun

parameter for k-NN prediction. Function is used to calculate distance-dependent weights. Any distance function must accept the two parameters x (distance) and sigma (maximum distance to give a weight > 0.0).

max.dist

parameter for k-NN prediction. Parameter sigma for dist.fun. In order to avoid rounding issues, it is recommended not to use exact integers as limit, but values like 1.1 to make sure, that all neurons with distance 1 are included.

strict

difference of maximum votes to assign class label (if the difference between the to two votes is smaller or equal to strict, unknown is predicted). default = 0.3.

name

name for the model. Name will be stored as slot model@name in the trained model.

continue

logical; if TRUE, the codebook vectors of the model, given in argument model will be used as initial codes.

len.total

number of previuos training steps.

codes

codes of a model to be used for initialisation.

Value

    S4 object of type \code{\link{SOMnn}} with the trained model

som.nn documentation built on May 29, 2024, 6:50 a.m.