map.kohonen | R Documentation |
Map a data matrix onto a trained SOM.
## S3 method for class 'kohonen'
map(x, newdata, whatmap = NULL, user.weights = NULL,
maxNA.fraction = x$maxNA.fraction, ...)
x |
An object of class |
newdata |
list of data matrices (numerical) of factors, equal to
the |
whatmap, user.weights, maxNA.fraction |
parameters that usually will
be taken from the |
... |
Currently ignored. |
A list with elements
unit.classif |
a vector of units that are closest to the objects in the data matrix. |
distances |
distances of the objects to the closest units. Distance measures are the same ones used in training the map. |
whatmap, user.weights |
Values used for these arguments. |
Ron Wehrens
predict.kohonen
, supersom
data(wines)
set.seed(7)
training <- sample(nrow(wines), 150)
Xtraining <- scale(wines[training, ])
somnet <- som(Xtraining, somgrid(5, 5, "hexagonal"))
map(somnet,
scale(wines[-training, ],
center=attr(Xtraining, "scaled:center"),
scale=attr(Xtraining, "scaled:scale")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.