Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ml-distance-euclidean

mljs840.2kMIT2.0.0TypeScript support: included

Compute the euclidean distance between two vectors

euclidean, squared, distance, metric, vector, data, mining, datamining, machine, learning

readme

ml-distance-euclidean

NPM version build status npm download

Compute the euclidean distance between two vectors

Installation

$ npm install ml-distance-euclidean

API

const { euclidean, squaredEuclidean } = require('ml-distance-euclidean');

euclidean([0, 1, 4, 6, 2], [3, 6, 9, 4, 3]); // 8

euclidean(p, q)

Returns the Euclidean distance between vectors p and q.

squaredEuclidean(p, q)

Returns the squared Euclidean distance between vectors p and q.

License

MIT

changelog

2.0.0 (2018-08-12)

Features

  • refactor to ES module and TypeScript (#2) (c03dcf2)

BREAKING CHANGES

    • Exports 'euclidean' and 'squaredEuclidean' as separate functions.
  • Stop supporting Node 4.

1.0.0 / 2015-07-11

  • first release