Skip to content

Compute a distance-matrix based on a custom distance function

License

Notifications You must be signed in to change notification settings

mljs/distance-matrix

Repository files navigation

distance-matrix

NPM version Test coverage npm download

Compute a distance/similarity matrix.

Installation

npm i ml-distance-matrix

Example

const distanceMatrix = require('ml-distance-matrix');
const { euclidean } = require('ml-distance-euclidean');

// Computes euclidan distance for each pair of possible vectors
const matrix = distanceMatrix([[8, -1, 2], [-4, 0, 3], [-3, -1, 6]], euclidean);

License

MIT

About

Compute a distance-matrix based on a custom distance function

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •