Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ml-nearest-vector

Package Overview
Dependencies
Maintainers
7
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ml-nearest-vector - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

tonic.js

5

History.md

@@ -0,1 +1,6 @@

<a name="1.0.1"></a>
## [1.0.1](https://github.com/mljs/nearest-vector/compare/v1.0.0...v1.0.1) (2016-10-20)
<a name="1.0.0"></a>

@@ -2,0 +7,0 @@ # 1.0.0 (2016-10-06)

5

package.json
{
"name": "ml-nearest-vector",
"version": "1.0.0",
"version": "1.0.1",
"description": "Find the nearest point to a sample point",
"main": "./src/index.js",
"files": [
"src"
"src",
"tonic.js"
],

@@ -9,0 +10,0 @@ "scripts": {

14

src/index.js

@@ -13,9 +13,9 @@ 'use strict';

* Find the nearest vector in a list to a sample vector
* @param {Array<Array<Number>>} listVectors - List of vectors with same dimensions
* @param {Array<Number>} vector - Reference vector to "classify"
* @param {Object} [options] - Options object
* @param {Function} [options.distanceFunction = squaredDistance] - Function that receives two vectors and return their distance value as number
* @param {Function} [options.similarityFunction = undefined] - Function that receives two vectors and return their similarity value as number
* @param {Boolean} [options.returnVector = false] - Return the nearest vector instead of its index
* @return {Number|Array<Number>} - The index or the content of the nearest vector
* @param {Array<Array<number>>} listVectors - List of vectors with same dimensions
* @param {Array<number>} vector - Reference vector to "classify"
* @param {object} [options] - Options object
* @param {function} [options.distanceFunction = squaredDistance] - Function that receives two vectors and return their distance value as number
* @param {function} [options.similarityFunction = undefined] - Function that receives two vectors and return their similarity value as number
* @param {boolean} [options.returnVector = false] - Return the nearest vector instead of its index
* @return {number|Array<number>} - The index or the content of the nearest vector
*/

@@ -22,0 +22,0 @@ function nearestVector(listVectors, vector, options) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc