Learn R Programming

SOMbrero (version 1.2)

trainSOM: Run the SOM algorithm

Description

The trainSOM function returns a somRes class object which contains the outputs of the algorithm.

Usage

trainSOM(x.data, ...) "print"(x, ...) "summary"(object, ...)

Arguments

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 initSOM for specifying the parameters of the algorithm. The default values of the arguments maxit and dimension are calculated according to the SOM type if the user does not set them:
  • maxit is equal to (number of rows+number of columns)*5 if the SOM type is korresp. It is equal to number of rows*5 in all other SOM types
  • dimension: for a korresp SOM, is approximately equal to the square root of the number of observations to be classified divided by 10 but it is never smaller than 5 or larger than 10.
x, object
an object of class somRes

Value

The trainSOM function returns an object of class somRes which contains the following components: contains the following components: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.

Details

The version of the SOM algorithm implemented in this package is the stochastic version.

Several variants able to handle non-vectorial data are also implemented in their stochastic versions: type="korresp" for contingency tables, as described in Cottrel et al., 1993 (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., 2016.

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 p-value is used which is based on the Fisher distribution and not on a permutation test.

References

Anderson, M. J. (2001). A new method for non-parametric multivariate analysis of variance. Austral Ecology, 26, 32--46.

Kohonen T. (2001) Self-Organizing Maps. Berlin/Heidelberg: Springer-Verlag, 3rd edition.

Cottrell, M., Letremy, P. (2005) How to use the Kohonen algorithm to simultaneously analyse individuals in a survey. Neurocomputing, 21, 119--138.

Cottrell, M., Letremy, P., Roy, E. (1993) Analyzing a contingency table with Kohonen maps: a Factorial Correspondence Analysis. In: Proceedings of IWANN'93, J. Cabestany, J. Mary, A. Prieto (Eds.), Lecture Notes in Computer Science, Springer-Verlag, 305--311.

Olteanu, M., Villa-Vialaneix, N. (2015a) On-line relational and multiple relational SOM. Neurocomputing, 147, 15-30.

Mariette, J. and Rossi, F. and Olteanu, M. and Mariette, J. (2016) Fast implementation of on-line relation SOM. Technical report.

See Also

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.

Examples

Run this code
# Run trainSOM algorithm on the iris data with 500 iterations
iris.som <- trainSOM(x.data=iris[,1:4])
iris.som
summary(iris.som)

Run the code above in your browser using DataLab