Numeric Production Mechanism

# npm

## ml-distance

4.0.0 • Public • Published

# ml-distance

Distance functions to compare vectors.

## Installation

### Similarities

• intersection(p, q)

Returns the Intersection similarity between vectors p and q

• czekanowski(p, q)

Returns the Czekanowski similarity between vectors p and q

• motyka(p, q)

Returns the Motyka similarity between vectors p and q

• kulczynski(p, q)

Returns the Kulczynski similarity between vectors p and q

• squaredChord(p, q)

Returns the Squared-chord similarity between vectors p and q

• jaccard(p, q)

Returns the Jaccard similarity between vectors p and q

• dice(p, q)

Returns the Dice similarity between vectors p and q

• tanimoto(p, q, [bitVector])

Returns the Tanimoto similarity between vectors p and q, and accepts the bitVector use, see the test case for an example

• tree(a,b, from, to, [options])

Refer to ml-tree-similarity

## Contributing

A new metric should normally be in its own file in the src/dist directory. There should be a corresponding test file in test/dist.
The metric should be then added in the exports of src/index.js with a relatively small but understandable name (use camelCase).
It should also be added to this README with either a link to the formula or an inline description.

MIT

## Keywords

### Install

npm i ml-distance

### Repository

github.com/mljs/distance

### Homepage

github.com/mljs/distance

767

4.0.0

MIT

246 kB

480