Detalhes do pacote

ml-nearest-vector

mljs314.5kMIT2.0.1

Find the nearest point to a sample point

machine, learning, data, mining

readme (leia-me)

nearest-vector

NPM version build status Test coverage David deps npm download

Find the nearest point to a sample point

Installation

$ npm install ml-nearest-vector

API Documentation

Example

import nearestVector, {findNearestVector} from 'ml-nearest-vector');

const nearestVector = require('ml-nearest-vector');

let centers = [[1, 2, 1], [-1, -1, -1]];
// returns the index of the nearest vector
nearestVector(centers, [1, 2, 1]) === 0;

// returns the nearest vector itself
findNearstVector(centers, [1, 2, 1]); // [1, 2, 1]

License

MIT

changelog (log de mudanças)

2.0.1 (2018-08-15)

Bug Fixes

2.0.0 (2018-08-15)

BREAKING CHANGES

  • two functions are now exproted, one that returns the nearest vector's index, the other the nearest vector itself

1.0.1 (2016-10-20)

1.0.0 (2016-10-06)

Features