kohonen (version 2.0.5)

supersom: Super-organising maps

Description

An extension of xyf maps to multiple data layers, possibly with different numbers of variables (though equal numbers of objects). NAs are allowed (see below). A weighted distance over all layers is calculated to determine the winning units during training.

Usage

supersom(data, grid=somgrid(), rlen = 100, alpha = c(0.05, 0.01),
    radius = quantile(nhbrdist, 0.67) * c(1, -1), 
    contin, toroidal = FALSE, n.hood, whatmap = NULL, weights = 1,
    maxNA.fraction = .5, keep.data = TRUE)

Arguments

data
list of data matrices.
grid
a grid for the representatives: see somgrid.
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 rlen updates.
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 run from the given number to the negative value of that number; as soon as the neighbourhood gets sma
contin
parameter indicating whether data are continuous or categorical. The default is to check whether all row sums equal 1: in that case contin is FALSE.
toroidal
if TRUE, the edges of the map are joined. Note that in a hexagonal toroidal map, the number of rows must be even.
n.hood
the shape of the neighbourhood, either "circular" or "square". The latter is the default for rectangular maps, the former for hexagonal maps.
whatmap
For supersom maps: what layers to use in the mapping.
weights
the weights given to individual layers. Default is 1/n, with n the number of layers.
maxNA.fraction
the maximal fraction of values that may be NA to prevent the row or column to be removed.
keep.data
save data in return value.

Value

  • an object of class "kohonen" with components
  • datadata matrix, only returned if keep.data == TRUE.
  • continparameter indicating whether elements of data are continuous or categorical.
  • na.rowsindices of objects (rows) that are removed because at least one of the layers has to many NAs for these objects.
  • unit.classifwinning units for all data objects, only returned if keep.data == TRUE.
  • distancesdistances of objects to their corresponding winning unit, only returned if keep.data == TRUE.
  • gridthe grid, an object of class somgrid.
  • codesa list of matrices containing codebook vectors.
  • changesmatrix of mean average deviations from code vectors; every map corresponds with one column.
  • toroidalwhether a toroidal map is used.
  • n.hoodthe shape of the neighbourhood, either "circular" or "square". The latter is the default for rectangular maps, the former for hexagonal maps.
  • weightsFor supersom maps: weights of layers uses in the mapping.
  • whatmapFor supersom maps: what layers to use in the mapping.
  • methodtype of map, here "supersom".

References

R. Wehrens and L.M.C. Buydens, J. Stat. Softw. 21 (5), 2007

See Also

somgrid, plot.kohonen

Examples

Run this code
data(yeast)
yeast.supersom <- supersom(yeast, somgrid(6, 6, "hexagonal"), whatmap = 3:6)
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", keepMargins = TRUE)

Run the code above in your browser using DataLab