The function is called by som.nn.train
and som.nn.continue
to train self-organising map with hexagonal tolology.
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
)
S4 object of type \code{\link{SOMnn}} with the trained model
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.
index of the column with as class labels (after beeing coerced to character).
kernel to be used for training.
dimension in x-direction.
dimension in y-direction.
logical
; if TRUE an endless som is trained as on the
surface of a torus.
number of steps to be trained (steps - not epochs!).
initial training rate.
inital radius for SOM training. Gaussian distance function is used, radius corresponds to sigma.
logical; if TRUE, input data is normalised with scale(x, TRUE, TRUE)
.
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).
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.
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 for the model. Name will be stored as slot model@name
in the
trained model.
logical; if TRUE, the codebook vectors of the model, given in argument model
will be used
as initial codes.
number of previuos training steps.
codes of a model to be used for initialisation.