map.missSOM: Map data to a supervised or unsupervised SOM

View source: R/map.R

mapR Documentation

Map data to a supervised or unsupervised SOM

Description

Map a data onto a trained SOM.

Usage

map(x, ...)

## S3 method for class 'missSOM'
map(x, newdata, maxNA.fraction = x$maxNA.fraction, ...)

Arguments

x

an object of class missSOM.

...

Currently ignored.

newdata

a matrix or data.frame, equal to the data argument of the imputeSOM function.

maxNA.fraction

parameters that usually will be taken from the x object, but can be supplied by the user as well. Note that it is not possible to change distance functions from the ones used in training the map. See imputeSOM for more information.

Value

A list with elements

unit.classif

a vector of units that are closest to the objects in the data.

dists

distances of the objects to the closest units. Distance measures are the same ones used in training the map.

See Also

imputeSOM

Examples

data(wines)
set.seed(7)

training <- sample(nrow(wines), 150)
Xtraining <- scale(wines[training, ])
somnet <- imputeSOM(Xtraining, somgrid(5, 5, "hexagonal"))

map(somnet, scale(wines[-training, ], 
                  center=attr(Xtraining, "scaled:center"), 
                  scale=attr(Xtraining, "scaled:scale")))


missSOM documentation built on May 5, 2022, 9:06 a.m.

Related to map.missSOM in missSOM...