Description Usage Arguments Details Value Note Author(s) See Also Examples
This function tunes some parameters of a Self-Organising Map by optimising a specified error measure. The prior structure is not optimised by this function.
1 2 3 4 |
data |
the data to which the SOM will be fitted. This can be, e.g., a matrix or data frame of observations (which should be scaled), or a distance matrix |
somgrid |
an object of class 'somgrid' |
control |
a control object which specifies the parameter to optimize |
weights |
optional weights for the data points |
verbose |
switch for tracing the tuning process |
internalVerbose |
switch for tracing each call to
|
x |
an object of class |
... |
not used |
The optimisation is done via a simple grid search that fit a Self-Organising Map for each possible combination of the parameters to tune. The prior structure itself is excluded from the optimisation as most quantisation related error measures decrease with the size of the grid.
An object of class "somtune"
, a list with components
best.som |
the best SOM according to the chosen error criterion |
errors |
the error for each configuration |
quantisation |
the quantisation error for each configuration |
isquant |
|
control |
the control object used by this call |
dimensions |
a list of strings with the names of the parameters that were varied by the function |
init,assignement,radii,annealing,kernel |
5 vectors containing the parameters used by each tested configuration |
best.index |
the index of the configuration used by the best SOM |
this function is modelled after David Mayer's tune function.
Fabrice Rossi
som.tunecontrol
and plot.somtune
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | data(iris)
# scaling
data <- scale(iris[1:4])
# a medium hexagonal grid
sg <- somgrid(xdim=15,ydim=15,topo="hex")
# choose a good SOM via Kaski and Lagus' error measure
tune.results <- som.tune(data,sg,
som.tunecontrol(sg,criterion=error.kaskilagus))
# print the results
print(tune.results)
# umatrix of the best SOM
umatrix(tune.results$best.som)
# give more weight to the first specie (i.e. setosa)
tune.results <- som.tune(data,sg,
som.tunecontrol(sg,criterion=error.kaskilagus),
weights=c(rep(3,50),rep(1,100)))
# print the results
print(tune.results)
# umatrix of the best SOM
umatrix(tune.results$best.som)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.