Socket
Socket
Sign inDemoInstall

ml-tree-similarity

Package Overview
Dependencies
Maintainers
5
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ml-tree-similarity

Compares two spectra using a tree similarity


Version published
Weekly downloads
210K
decreased by-18.11%
Maintainers
5
Weekly downloads
 
Created
Source

tree-similarity

NPM version build status 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 = [[1, 2, 3, 4, 5, 6, 7], [0.3, 0.7, 4, 0.3, 0.2, 5, 0.3]];
const b = [[1, 2, 3, 4, 5, 6, 7], [0.3, 4, 0.7, 0.3, 5, 0.2, 0.3]];

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

// a pre-calculated tree is also a valid input
const ans = treeSimilarity(A, b, options);

API Documentation

This algorithm was based in the following papers:

License

MIT

FAQs

Package last updated on 29 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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