Description Usage Arguments Details Value Author(s) References See Also Examples
A supersom is an extension of selforganising maps (SOMs) to multiple
data layers, possibly with different numbers and different types of
variables (though equal numbers of objects). NAs are allowed. A
weighted distance over all layers is calculated to determine the
winning units during training.
Functions som
and xyf
are simply wrappers for supersoms
with one and two layers, respectively. Function bdk
is deprecated.
1 2 3 4 5 6 7 8  som(X, ...)
xyf(X, Y, ...)
supersom(data, grid=somgrid(), rlen = 100, alpha = c(0.05, 0.01),
radius = quantile(nhbrdist, 2/3),
whatmap = NULL, user.weights = 1, maxNA.fraction = 0L,
keep.data = TRUE, dist.fcts = NULL,
mode = c("online", "batch", "pbatch"), cores = 1, init,
normalizeDataLayers = TRUE)

X, Y 
numerical data matrices, or factors. 
data 
list of data matrices (numerical) of factors. If a vector is entered, it will be converted to a onecolumn matrix. 
grid 
a grid for the codebook vectors:
see 
rlen 
the number of times the complete data set will be presented to the network. 
alpha 
learning rate, a vector of two numbers indicating the
amount of change. Default is to decline linearly from 0.05 to 0.01
over 
radius 
the radius of the neighbourhood, either given as a
single number or a vector (start, stop). If it is given as a single
number the radius will change linearly from 
whatmap 
What data layers to use. If unspecified all layers are used. 
user.weights 
the weights given to individual layers. This can
be a single number (all layers have the same weight, the default), a
vector of the same length as the 
maxNA.fraction 
the maximal fraction of values that may be NA to prevent the row or column to be removed. 
keep.data 
if TRUE, return original data and mapping information. If FALSE, only return the trained map (in essence the codebook vectors). 
dist.fcts 
vector of distance functions to be used for the
individual data layers, of the same length as the 
mode 
type of learning algorithm. 
cores 
number of cores to use in the "pbatch" learning mode. The default, 1, corresponds to using all available cores. 
init 
list of matrices, initial values for the codebook vectors. The list should have the same length as the data list, and corresponding numbers of variables (columns). Each list element should have a number of rows corresponding to the number of units in the map. 
normalizeDataLayers 
boolean, indicating whether

... 
Further arguments for the 
In order to avoid some layers to overwhelm others, simply
because of the scale of the data points, the supersom
function
by default applies internal weights to balance this. The user.weights
argument is applied on top of that: the result is that when a user
specifies equal weights for all layers (the default), all layers
contribute equally to the global distance measure. For large data
sets (defined as containing more than 500 records), a sample of size
500 is used to calculate the mean distances in each data layer. If
normalizeDataLayers == FALSE
the user weights are applied
directly to the data (distance.weights
are set to 1).
Various definitions of the Tanimoto distance exist in the literature. The implementation here returns (for two binary vectors of length n) the fraction of cases in which the two vectors disagree. This is basically the Hamming distance divided by n  the incorrect naming is retained (for the moment) to guarantee backwards compatibility. If the vectors are not binary, they will be converted to binary strings (with 0.5 as the class boundary). This measure should not be used when variables are outside the range [01]; a check is done to make sure this is the case.
An object of class "kohonen" with components
data 
data matrix, only returned if 
unit.classif 
winning units for all data objects,
only returned if 
distances 
distances of objects to their corresponding winning
unit, only returned if 
grid 
the grid, an object of class 
codes 
a list of matrices containing codebook vectors. 
changes 
matrix of mean average deviations from code vectors; every map corresponds with one column. 
alpha, radius, user.weights, whatmap, maxNA.fraction 
input arguments presented to the function. 
distance.weights 
if 
dist.fcts 
distance functions corresponding to all layers of the data, not just the ones indicated by the whatmap argument. 
Ron Wehrens and Johannes Kruisselbrink
R. Wehrens and L.M.C. Buydens, J. Stat. Softw. 21 (5), 2007; R. Wehrens and J. Kruisselbrink, submitted, 2017.
somgrid
, plot.kohonen
,
predict.kohonen
, map.kohonen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  data(wines)
## som
som.wines < som(scale(wines), grid = somgrid(5, 5, "hexagonal"))
summary(som.wines)
## xyf
xyf.wines < xyf(scale(wines), vintages, grid = somgrid(5, 5, "hexagonal"))
summary(xyf.wines)
## supersom example
data(yeast)
yeast.supersom < supersom(yeast, somgrid(6, 6, "hexagonal"),
whatmap = c("alpha", "cdc15", "cdc28", "elu"),
maxNA.fraction = .5)
plot(yeast.supersom, "changes")
obj.classes < as.integer(yeast$class)
colors < c("yellow", "green", "blue", "red", "orange")
plot(yeast.supersom, type = "mapping", col = colors[obj.classes],
pch = obj.classes, main = "yeast data")

SOM of size 5x5 with a hexagonal topology and a bubble neighbourhood function.
Training data included of 177 objects
The number of layers is 1
Mean distance to the closest unit in the map: 3.478217
SOM of size 5x5 with a hexagonal topology and a bubble neighbourhood function.
Training data included of 177 objects
The number of layers is 2
Mean distance to the closest unit in the map: 0.0947549
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.