# Sample code for preparing to use 2S-SOM algorithm.
This sample code shows with un example how to train a SOM Map using 2S-SOM algorithm and data from a geophysical exemple.
## The example problem:
Using a three-physical-variables two-groups problem to be trained using the 2S-SOM
algorithm. We are only interested here, for instance, in the group coefficients
ALPHA, and we let the variables or columns coefficients, BETA, constant and
equal. This will be driven by a particular use of Lambda and Eta input
parameters. See code.
Data array dimension is 36 x N. 36 is the composition of thee geophysical
variable dimensions of (12, 12, 12) and N the number of patterns.
We take the first 12 columns, for the first 2S-SOM group and the rest, 24 columns,
for the second group.
__SEE MORE DETAILS IN THE `SCRIPT_RUNNING_2S_SOM.M` MATLAB SCRIPT FILE.
## Software needed :
For 2S-SOM get the software at git page:
https://github.com/carmman/2S-SOM_versionCM
You should use `learn_2s_som.m` funtion found in `Code-2S-SOM/` and functions in `Code-2S-SOM/2s_som/` subdirectories.
Also, some functions having the same name as original SOM Toolbox functions as
`som_batchtrain.m`, `som_make.m` and `som_randinit.m`, found it in
`Code-2S-SOM/som_for_2s_som/` subdir.
You need the SOM Toolbox. See ilarinieminen git page at
https://github.com/ilarinieminen/SOM-Toolbox
you will need the functions in `som/` subdirectory.
See ADDPATH examples in SCRIPT_RUNNING_2S_SOM script code for knowing the order of how to declare it.
## History:
19/07/2019 ... Main developpement of 2S-SOM Matlab functions was made by Khalil Yala at Locean
Laboratory et Sorbonne Universites and adapted and put in GitHub by C.Mejia
IPSL/Locean same institution who writes also this script.