Here is an example for our library kohonen, a basic implementation of SOM algorithm in JavaScript
It provides both:
- a script using the lib to map a dataset from a multidimensional space into a 2d hexagonal grid of neurons
- and a script to draw the hexagonal grid
yarn
This example is about classifying 155 stars from their spectral data (2799 by stars). You can read more about this problem by reading this article Application of Self-Organizing Map to stellar spectral classifications included on the repository and on which is based this example.
There is a first script to parse the 2 dat files:
- stars.dat: description of each stars including their spectral type
- fluxes.dat: 2799 data for each stars
The second script is the SOM calculation itself using our lib (the repository already provides a generated grid)
npm run parse
npm run som
Visualisation is made with React and d3
npm start