A Python Library for Self Organizing Map (SOM)
As much as possible, the structure of SOM is similar to
somtoolbox in Matlab. It has the following functionalities:
- Only Batch training, which is faster than online training. It has parallel processing option similar to
sklearnformat and it speeds up the training procedure, but it depends on the data size and mainly the size of the SOM grid.I couldn't manage the memory problem and therefore, I recommend single core processing at the moment. But nevertheless, the implementation of the algorithm is carefully done for all those important matrix calculations, such as
scipysparse matrix and
numexprfor calculation of Euclidean distance.
- PCA (or RandomPCA (default)) initialization, using
sklearnor random initialization.
- component plane visualization (different modes).
- U-Matrix visualization.
- 1-d or 2-d SOM with only rectangular, planar grid. (works well in comparison with hexagonal shape, when I was checking in Matlab with somtoolbox).
- Different methods for function approximation and predictions (mostly using Sklearn).
SOMPY has the following dependencies (tested only with Python 2.7x):
python setup.py install
Many thanks to @sebastiandev, the library is now standardized in a pythonic tradition. Below you can see some basic examples, showing how to use the library. But I recommend you to go through the codes. There are several functionalities already implemented, but not documented. I would be very happy to add your new examples here.
There is no published paper about this library. However if possible, please cite the library as follows:
Main Contributers: Vahid Moosavi @sevamoo Sebastian Packmann @sebastiandev Iván Vallés @ivallesp
Thanks a lot. Best Vahid Moosavi