2.2.0 • Published 3 months ago

ml-tree-similarity v2.2.0

Weekly downloads
296
License
MIT
Repository
github
Last release
3 months ago

tree-similarity

NPM version Test coverage npm download

Compares two spectra using a tree similarity.

Installation

$ npm i ml-tree-similarity

Usage

import { createTree, treeSimilarity } from 'ml-tree-similarity';

const a = {
  x: [1, 2, 3, 4, 5, 6, 7],
  y: [0.3, 0.7, 4, 0.3, 0.2, 5, 0.3],
};
const b = {
  x: [1, 2, 3, 4, 5, 6, 7],
  y: [0.3, 4, 0.7, 0.3, 5, 0.2, 0.3],
};

// create a tree
const options = { from: 1, to: 7 };
const aTree = createTree(a, options);
const bTree = createTree(b, options);

const ans = treeSimilarity(aTree, bTree, options);

API Documentation

This algorithm was based in the following papers:

License

MIT

2.2.0

3 months ago

2.1.0

3 months ago

2.0.0

3 months ago

1.0.0

5 years ago

0.1.0

7 years ago

0.0.0

9 years ago