graphclust.manifold.SelfOrganizingMap#
- class graphclust.manifold.SelfOrganizingMap(grid=(10, 10), *, topology='hexagonal', n_epochs=50, sigma=(None, 0.5))[source]#
Bases:
_MapperKohonen’s self-organizing map (batch training).
The nodes sit on a fixed 2-D lattice (
gridrows x columns, rectangular or hexagonal). In each epoch every node becomes the neighborhood-weighted mean of the samples, with Gaussian neighborhood \(h_{ij}=\exp(-\|\mathbf{r}_i-\mathbf{r}_j\|^2/2\sigma(t)^2)\) on the lattice and \(\sigma\) shrinking fromsigma[0](default: half the larger grid side) tosigma[1]. The nodes are initialized on the plane of the first two principal components. Batch training is deterministic and much faster than the original online rule, with the same fixed points.- Attributes:
- nodes_ (prototype vectors), grid_positions_ (lattice coordinates, the map),
- adjacency_ (lattice neighbors), embedding_ (lattice position of the BMU of every training sample).