Description Usage Arguments Value Author(s) See Also Examples
Compute the quantisation error made by a fitted Self-Organising Map: this is the mean of the Euclidean distance between each observation and the prototype of its best matching unit.
1 2 | ## S3 method for class 'somnum'
error.quantisation(som, newdata, ...)
|
som |
an object of class |
newdata |
an optional matrix or a data frame of observations compatible with the fitted som |
... |
not used |
If newdata
is not given, the function returns the quantisation
error made by the fitted som on the data used to fit it. When
newdata
is specified, the function returns the quantisation
error of the
fitted som on the corresponding data.
Fabrice Rossi
error.kaskilagus.somnum
, som.tunecontrol
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(iris)
# scaling
data <- scale(iris[1:4])
# a small hexagonal grid
sg <- somgrid(xdim=7,ydim=7,topo="hex")
# fit the SOM
som <- batchsom(data,sg)
print(error.quantisation(som))
# a larger grid should in general give a lower quantisation error
sg <- somgrid(xdim=12,ydim=12,topo="hex")
som <- batchsom(data,sg)
print(error.quantisation(som))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.