predict.som: Predict function for a self-organising map

predict.somR Documentation

Predict function for a self-organising map

Description

Returns the cluster of the closest unit of the map, for a new dataset.

Usage

## S3 method for class 'som'
predict(object, newdata, ...)

Arguments

object

The map (created by SOM).

newdata

A new dataset (a data.frame), with the same variables as the learning dataset.

...

Other parameters.

Value

A vector of cluster numbers.

See Also

SOM, plot.som

Examples


require (datasets)
data (iris)
d = splitdata (iris, 5)
model = SOM (d$train.x, 4, 4)
table (predict (model, d$test.x), d$test.y)


fdm2id documentation built on Aug. 28, 2026, 9:07 a.m.