ml-distance-euclidean
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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

Package Sidebar

Install

npm i ml-distance-euclidean

Weekly Downloads

366,640

Version

2.0.0

License

MIT

Unpacked Size

5.23 kB

Total Files

7

Last publish

Collaborators

  • mljs-bot
  • stropitek
  • targos
  • lpatiny