How to use the mnemonist/vp-tree function in mnemonist

To help you get started, we’ve selected a few mnemonist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Yomguithereal / talisman / src / clustering / record-linkage / vp-tree.js View on Github external
run() {

    // Building the tree
    const tree = new VPTree(this.distance, this.items);

    // Retrieving the clusters
    const clusters = [],
          visited = new Set();

    for (let i = 0, l = this.items.length; i < l; i++) {
      const item = this.items[i];

      if (visited.has(item))
        continue;

      const neighbors = tree.neighbors(this.radius, item);

      const cluster = new Array(neighbors.length);

      for (let j = 0, m = neighbors.length; j < m; j++) {

mnemonist

Curated collection of data structures for the JavaScript/TypeScript.

MIT
Latest version published 10 months ago

Package Health Score

76 / 100
Full package analysis