map.kohonen {kohonen} | R Documentation |
Map a data matrix onto a trained SOM.
## S3 method for class 'kohonen' map(x, newdata, whatmap = NULL, weights, scale.distances = (nmaps > 1), ...)
x |
A trained supervised or unsupervised SOM obtained from
functions |
newdata |
Data matrix, with rows corresponding to objects. |
whatmap |
For |
weights |
For |
scale.distances |
whether to rescale distances per layer in the
case of |
... |
Currently ignored. |
A list with elements
unit.classif |
a vector of units that are closest to the objects in the data matrix. |
dists |
distances (currently only Euclidean distances) of the objects to the units. |
whatmap,weights,scale.distances |
Values used for these arguments. |
Ron Wehrens
data(wines) set.seed(7) training <- sample(nrow(wines), 120) Xtraining <- scale(wines[training, ]) somnet <- som(Xtraining, somgrid(5, 5, "hexagonal")) mapping <- map(somnet, scale(wines[-training, ], center=attr(Xtraining, "scaled:center"), scale=attr(Xtraining, "scaled:scale")))