How-to
- Q
- I have data matrix D. How do I make a map ?
- A
-
Make sure each row of D corresponds to one data vector
(e.g. D(1,:)). First you must initialize the map with
sMap = som_init(D);
and then train it
sMap = som_train(sMap,D);
That's it! You can visualize it using
som_show(sMap);
- Q
- How do I get the map coordinates from BMU index ?
- Q
- How do I get the map unit index from map coordinates ?
- A
-
In Matlab you can refer to matrices in two ways:
- using the matrix indexes along i, j, k, etc. directions
(in SOM Toolbox: the unit coordinates)
- using the linear index to the matrix structure
(in SOM Toolbox: the BMU index)
The functions som_sub2ind and som_ind2sub act as
a bridge between these indexing methods. For example:
coords = som_ind2sub(msize,bmu_index);
bmu_index = som_sub2ind(msize,coords);
somtlbx@mail.cis.hut.fi