NNSOM.plots.SOMPlots.component_positions

SOMPlots.component_positions(x)[source]

Visualizes the positions of the components in a Self-Organizing Map (SOM) along with the input vectors.

This method plots the trained SOM weight vectors as gray dots and the input vectors as green dots on a 2D plot. It also connects neighboring SOM neurons with red lines to represent the grid structure, illustrating the organization and clustering within the map.

Parameters:

x (array-like) – A 2D array or sequence of vectors, typically representing input data or test data that has been projected onto the SOM.