ml-tree-similarity
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.2.0
    618
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.2.0
    618
  • 2.1.0
    7
  • 2.0.0
    7
  • 1.0.0
    554,466
  • 0.1.0
    14
  • 0.0.0
    189

Package Sidebar

Install

npm i ml-tree-similarity

Weekly Downloads

555,301

Version

2.2.0

License

MIT

Unpacked Size

33.5 kB

Total Files

43

Last publish

Collaborators

  • stropitek
  • targos
  • lpatiny
  • mljs-bot
  • maasencioh