The trainSOM
function returns a somRes
class
object which contains the outputs of the algorithm.
trainSOM(x.data, ...) # S3 method for somRes print(x, ...) # S3 method for somRes summary(object, ...)
x.data  a data frame or matrix containing the observations to be mapped on the grid by the SOM algorithm. 

...  Further arguments to be passed to the function

x  an object of class 
object  an object of class 
The trainSOM
function returns an object of class somRes
which contains the following components:
clusteringthe final classification of the data.
prototypesthe final coordinates of the prototypes.
energythe final energy of the map.
backupa list containing some intermediate backups of the prototypes
coordinates, clustering, energy and the indexes of the recorded backups, if
nb.save
is set to a value larger than 1.
datathe original dataset used to train the algorithm.
parametersa list of the map's parameters, which is an object of
class paramSOM
as produced by the function initSOM
.
The function summary.somRes
also provides an ANOVA (ANalysis Of
VAriance) of each input numeric variables in function of the map's clusters.
This is helpful to see which variables participate to the clustering.
The version of the SOM algorithm implemented in this package is the stochastic version.
Several variants able to handle nonvectorial data are also implemented in
their stochastic versions: type="korresp"
for contingency tables, as
described in Cottrell et al., 2004 (with weights as in Cottrel and Letremy,
2005); type="relational"
for dissimilarity matrices, as described in
Olteanu et al., 2015, with the fast implementation introduced in Mariette
et al., 2017.
summary
produces a complete summary of the results that displays the
parameters of the SOM, quality criteria and ANOVA. For type="numeric"
the ANOVA is performed for each input variable and test the difference of
this variable accross the clsuters of the map. For type="relational"
a
dissimilarity ANOVA is performed (see (Anderson, 2001), except that in the
present version, a crude estimate of the pvalue is used which is based on
the Fisher distribution and not on a permutation test.
Warning! Recording intermediate backups with the argument
nb.save
can strongly increase the computational time since calculating
the entire clustering and the energy is time consumming. Use this option with
care and only when it is strictly necessary.
Anderson M.J. (2001). A new method for nonparametric multivariate analysis of variance. Austral Ecology, 26, 3246.
Kohonen T. (2001) SelfOrganizing Maps. Berlin/Heidelberg: SpringerVerlag, 3rd edition.
Cottrell M., Ibbou S., Letremy P. (2004) SOMbased algorithms for qualitative variables. Neural Networks, 17, 11491167.
Cottrell M., Letremy P. (2005) How to use the Kohonen algorithm to simultaneously analyse individuals in a survey. Neurocomputing, 21, 119138.
Olteanu M., VillaVialaneix N. (2015) Online relational and multiple relational SOM. Neurocomputing, 147, 1530.
Mariette J., Rossi F., Olteanu M., Mariette J. (2017) Accelerating stochastic kernel SOM. In: M. Verleysen, XXVth European Symposium on Artificial Neural Networks, Computational Intelligence and Machine Learning (ESANN 2017), i6doc, Bruges, Belgium, 269274.
See initSOM
for a description of the paramaters to
pass to the trainSOM function to change its behavior and
plot.somRes
to plot the outputs of the algorithm.
# Run trainSOM algorithm on the iris data with 500 iterations iris.som < trainSOM(x.data=iris[,1:4]) iris.som#> SelfOrganizing Map object... #> online learning, type: numeric #> 5 x 5 grid with square topology #> neighbourhood type: gaussian #> distance type: euclideansummary(iris.som)#> #> Summary #> #> Class : somRes #> #> SelfOrganizing Map object... #> online learning, type: numeric #> 5 x 5 grid with square topology #> neighbourhood type: gaussian #> distance type: euclidean #> #> Final energy : 0.8543395 #> Topographic error: 0.07333333 #> #> ANOVA : #> #> Degrees of freedom : 14 #> #> F pvalue significativity #> Sepal.Length 42.669 0 *** #> Sepal.Width 18.012 0 *** #> Petal.Length 295.589 0 *** #> Petal.Width 160.906 0 *** #>