
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A basic implementation of a Kohonen map in JavaScript
`We are still on an early stage of dev. Do not use this package until v1.0.0 has been released.
npm i kohonen --save
Then, in your JS script :
import Kohonen, {hexagonHelper} from 'kohonen';
The Kohonen class is the main class.
| param name | definition | type | mandatory | default |
|---|---|---|---|---|
| neurons | grid of neurons | Array | yes | |
| data | dataset | Array of Array | yes | |
| maxStep | step max to clamp | Number | no | 10000 |
| maxLearningCoef | Number | no | 1 | |
| minLearningCoef | Number | no | .3 | |
| maxNeighborhood | Number | no | 1 | |
| minNeighborhood | Number | no | .3 |
// instanciate your Kohonen map
const k = new Kohonen({data, neurons});
// you can use the grid helper to generate a grid with 10x10 hexagons
const k = new Kohonen({data, neurons: hexagonHelper.generateGrid(10,10)});
neurons parameter should be a flat array of { pos: [x,y] }. pos array being the coordinate on the grid.
data parameter is an array of the vectors you want to display. There is no need to standardize your data, that will
be done internally by scaling each feature to the [0,1] range.
Basically the constructor do :
| param name | definition | type | mandatory | default |
|---|---|---|---|---|
| log | func called after each step of learning process | Function | no | ()=>{} |
k.training();
training method iterates on random vectors picked on normalized data.
If a log function is provided as a parameter, it will receive instance neurons and step as params.
mapping method returns grid position for each data provided on the constructor.
const myPositions = k.mapping();
umatrix method returns the U-Matrix of the grid (currently only with standardized vectors).
const umatrix = k.umatrix();
We've developed a full example on a dedicated repository
FAQs
A basic implementation of a Kohonen map in JavaScript
The npm package kohonen receives a total of 15 weekly downloads. As such, kohonen popularity was classified as not popular.
We found that kohonen demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.