Giter Site home page Giter Site logo

som's Introduction

som

Som is a a self organizing map implementation written in JavaScript.

Installation

npm install som

Example

//Create a SOM of four (width X height) nodes.  It will expect five items to be submitted for training.
var som = require('som').create({features:  ['hello', 'hola', 'ciao'], iterationCount: 5, width: 2, height: 2});
var util = require('util');

//initialize SOM with default distance function (euclidean)
som.init({});

//begin training SOM
som.train('english-1', {'hello': 1, 'hola': 0, 'ciao': 0});
som.train('spanish-1', {'hello': 0, 'hola': 1, 'ciao': 0});
som.train('italian-1', {'hello': 0, 'hola': 0, 'ciao': 1});
som.train('english-2', {'hello': 4, 'hola': 0, 'ciao': 1});
som.train('english-3', {'hello': 5, 'hola': 0});

//Look at the internal structure of the SOM
console.log('SOM', util.inspect(som, false, 8));

//look at the index of trained nodes in the SOM
console.log('INDEX', util.inspect(som.traineeIndex, false, 8));

//Perform a SOM neigborhood search of distance 2 from the node that holds the value 'english-1'.
var neighbors = som.neighbors('english-1', 2);
console.log('NEIGHBORS', util.inspect(neighbors, false, 8));

som's People

Contributors

bediako avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.