{"name":"ml-distance","version":"4.0.0","keywords":["distance","similarity","metric","vector","data","mining","datamining","machine","learning"],"author":{"name":"Michaël Zasso"},"license":"MIT","_id":"ml-distance@4.0.0","maintainers":[{"name":"stropitek","email":"kostro.d@gmail.com"},{"name":"targos","email":"targos+npm@protonmail.com"},{"name":"lpatiny","email":"luc@patiny.com"},{"name":"mljs-bot","email":"bot+npm-mljs@zakodium.com"},{"name":"cheminfo-bot","email":"bot+npm-cheminfo@zakodium.com"},{"name":"maasencioh","email":"maasencioh@gmail.com"},{"name":"jeffersonh44","email":"jeffersonh44@gmail.com"},{"name":"andcastillo","email":"andcastillo@gmail.com"}],"contributors":[{"name":"Miguel Asencio"}],"homepage":"https://github.com/mljs/distance","bugs":{"url":"https://github.com/mljs/distance/issues"},"dist":{"shasum":"197c272abea03f13e1746e59a35be4491566bfdc","tarball":"http://registry-npm.ywwl.com/ml-distance/download/ml-distance-4.0.0.tgz","fileCount":480,"integrity":"sha512-zj7+UGZpHk3uL7n79XTfGNUjIGnhLn8xVvrxYvBHvXFxo3jq1q+/UjP311hZxnLVhbxbXCjUniThX8gozjacYA==","signatures":[{"sig":"MEUCIANYV1oGTp+d6Gx1fhBphKpetEBQJZ1SknsDTdYPbYzHAiEAogdYyXD5RJSP9vY/zRDiB2VQiuRd4RKUg8edT3EHfkI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":245886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuFWrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmodfA/6A/XafK0q670a6cGRpw1Fo4Bd7o+onMBy98sZDgq8u4nnc8NC\r\njT3qR9lvFT86549wlRipU2jBOO7vntusGqK+F/XxI4uDSoaAQsFB304ugvnA\r\nQaUv8+F3rnPTwd81hMVYe2J7A7lEjz9VYhJlp8qMJl2zNk/Pt8/rlNHXK8/R\r\nmpIc4xAlnsY3iaj4YZgohHf5kP50vnu86JFLvGpvdi0s+5JDc/XcgwE2ar/1\r\nQv1NOmEAf27oMWOWmPwAkAVzuChmetcBb7dT+eKtDvvu8FO56yUUKhx404y/\r\nd7Tw18D9S2NEXIELiqHAltZUV0fFprUCN55KeBWWEOy07eKfKhFkLzfDjgST\r\nCgnfiS11drR1/rXIT0XnwJWiLAJ4zVnS4vIUDJx4t/F/X/eUfH+L7SaQ269d\r\nNq17660NAYGvTcvHni27Da+SHx1soq9WtBUd0Bv5CL2j2i/Dja4jpWEwAdQ6\r\neTrT/svuQRNOFyG/5OxeuALLHXySLv34TpuIZCDJYh/pn66C+hjnWLdFUlFf\r\nPbdCNv7q+7u8zAqeF0Dd5umWppru9f4+HoG0QPk69iyHxhY0Q9YnKj1xQBfU\r\nLfeO35D0c24vw01HM5eTsaUGZCieEACXQB3P82mcEAQKQvwMjWe/ATyY6uY/\r\nMHlFipJ+c40ipYCvSiEwIkHX5qwh9YN5NvA=\r\n=3rTy\r\n-----END PGP SIGNATURE-----\r\n","size":29255,"noattachment":false,"key":"/ml-distance/-/ml-distance-4.0.0.tgz"},"main":"lib/index.js","types":"./lib/index.d.ts","module":"./lib-esm/index.js","gitHead":"cbfe008c34e8334ffb4823a367926ca63060494f","scripts":{"tsc":"npm run clean && npm run tsc-cjs && npm run tsc-esm","test":"npm run test-coverage && npm run eslint && npm run check-types","clean":"rimraf lib lib-esm","eslint":"eslint src","prepack":"npm run tsc","tsc-cjs":"tsc --project tsconfig.cjs.json","tsc-esm":"tsc --project tsconfig.esm.json","prettier":"prettier --check src","test-only":"jest","eslint-fix":"npm run eslint -- --fix","check-types":"tsc --noEmit","test-coverage":"jest --coverage","prettier-write":"prettier --write src"},"_npmUser":{"name":"mljs-bot","email":"bot+npm-mljs@zakodium.com"},"repository":{"url":"git+https://github.com/mljs/distance.git","type":"git"},"_npmVersion":"8.19.2","description":"Distance and similarity functions to compare vectors","directories":{},"_nodeVersion":"16.18.1","dependencies":{"ml-array-mean":"^1.1.6","ml-tree-similarity":"^1.0.0","ml-distance-euclidean":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","jest":"^29.3.1","eslint":"^8.30.0","rimraf":"^3.0.2","prettier":"^2.8.1","typescript":"^4.9.4","@types/jest":"^29.2.4","cheminfo-types":"^1.4.0","@babel/preset-typescript":"^7.18.6","eslint-config-cheminfo-typescript":"^11.2.2","@babel/plugin-transform-modules-commonjs":"^7.20.7"},"_npmOperationalInternal":{"tmp":"tmp/ml-distance_4.0.0_1673024939053_0.2562466777411747","host":"s3://npm-registry-packages"},"readme":"# ml-distance\n\n<h3 align=\"center\">\n\n  <a href=\"https://www.zakodium.com\">\n   <img src=\"https://www.zakodium.com/brand/zakodium-logo-white.svg\" width=\"50\" alt=\"Zakodium logo\" />\n  </a>\n\n  <p>\n    Maintained by <a href=\"https://www.zakodium.com\">Zakodium</a>\n  </p>\n\n[![NPM version][npm-image]][npm-url]\n[![Node.js CI](https://github.com/mljs/distance/actions/workflows/nodejs.yml/badge.svg)](https://github.com/mljs/distance/actions/workflows/nodejs.yml)\n[![Test coverage][codecov-image]][codecov-url]\n[![npm download][download-image]][download-url]\n\n</h3>\n\nDistance functions to compare vectors.\n\n## Installation\n\n`$ npm i ml-distance`\n\nThis package is ESM-only. CommonJS consumers need Node.js >= 20.19, >= 22.12, or\nany 24.x or later to `require()` it, or should migrate to `import`.\n\n## Usage\n\n```js\nimport { distance, similarity } from 'ml-distance';\n\nconst p = [0, 1, 2, 3, 4];\nconst q = [4, 3, 2, 1, 0];\n\ndistance.euclidean(p, q); // 6.324555320336759\ndistance.manhattan(p, q); // 12\nsimilarity.cosine(p, q); // 0.3333333333333333\n```\n\n## Methods\n\n### Distances\n\n- `euclidean(p, q)`\n\nReturns the [euclidean distance](http://en.wikipedia.org/wiki/Euclidean_distance#n_dimensions) between vectors p and q\n\n$d(p,q)=\\sqrt{\\sum\\limits_{i=1}^{n}(p_i-q_i)^2}$\n\n- `manhattan(p, q)`\n\nReturns the [city block distance](http://en.wikipedia.org/wiki/Taxicab_geometry) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{\\left|p_i-q_i\\right|}$\n\n- `minkowski(p, q, d)`\n\nReturns the [Minkowski distance](http://en.wikipedia.org/wiki/Minkowski_distance) between vectors p and q for order d\n\n- `chebyshev(p, q)`\n\nReturns the [Chebyshev distance](http://en.wikipedia.org/wiki/Chebyshev_distance) between vectors p and q\n\n$d(p,q)=\\max\\limits_i(|p_i-q_i|)$\n\n- `sorensen(p, q)`\n\nReturns the [Sørensen distance](http://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient) between vectors p and q\n\n$d(p,q)=\\frac{\\sum\\limits_{i=1}^{n}{\\left|p_i-q_i\\right|}}{\\sum\\limits_{i=1}^{n}{p_i+q_i}}$\n\n- `gower(p, q)`\n\nReturns the [Gower distance](https://stat.ethz.ch/education/semesters/ss2012/ams/slides/v4.2.pdf) between vectors p and q\n\n$d(p,q)=\\frac{\\sum\\limits_{i=1}^{n}{\\left|p_i-q_i\\right|}}{n}$\n\n- `soergel(p, q)`\n\nReturns the [Soergel distance](http://www.orgchm.bas.bg/~vmonev/SimSearch.pdf) between vectors p and q\n\n$d(p,q)=\\frac{\\sum\\limits_{i=1}^{n}{\\left|p_i-q_i\\right|}}{\\sum\\limits_{i=1}^{n}{max(p_i,q_i)}}$\n\n- `kulczynski(p, q)`\n\nReturns the [Kulczynski distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\frac{\\sum\\limits_{i=1}^{n}{\\left|p_i-q_i\\right|}}{\\sum\\limits_{i=1}^{n}{min(p_i,q_i)}}$\n\n- `canberra(p, q)`\n\nReturns the [Canberra distance](http://en.wikipedia.org/wiki/Canberra_distance) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}\\frac{\\left|{p_i-q_i}\\right|}{p_i+q_i}$\n\n- `lorentzian(p, q)`\n\nReturns the [Lorentzian distance](https://stat.ethz.ch/education/semesters/ss2012/ams/slides/v4.2.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}\\ln(\\left|{p_i-q_i}\\right|+1)$\n\n- `intersection(p, q)`\n\nReturns the [Intersection distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=1-\\sum\\limits_{i=1}^{n}min(p_i,q_i)$\n\n- `waveHedges(p, q)`\n\nReturns the [Wave Hedges distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}\\left(1-\\frac{min(p_i,q_i)}{max(p_i,q_i)}\\right)$\n\n- `czekanowski(p, q)`\n\nReturns the [Czekanowski distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=1-\\frac{2\\sum\\limits_{i=1}^{n}{min(p_i,q_i)}}{\\sum\\limits_{i=1}^{n}{p_i+q_i}}$\n\n- `motyka(p, q)`\n\nReturns the [Motyka distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=1-\\frac{\\sum\\limits_{i=1}^{n}{min(p_i,q_i)}}{\\sum\\limits_{i=1}^{n}{p_i+q_i}}$\n\nNote: distance between 2 identical vectors is 0.5 !\n\n- `tanimoto(p, q, [bitVector])`\n\nReturns the [Tanimoto distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q, and accepts the bitVector use, see the test case for an example\n\n- `innerProduct(p, q)`\n\nReturns the [Inner Product similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$s(p,q)=\\sum\\limits_{i=1}^{n}{p_i\\cdot{q_i}}$\n\n- `harmonicMean(p, q)`\n\nReturns the [Harmonic mean similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=2\\sum\\limits_{i=1}^{n}\\frac{p_i\\cdot{q_i}}{p_i+q_i}$\n\n- `jaccard(p, q)`\n\nReturns the [Jaccard distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=1-\\frac{\\sum\\limits_{i=1}^{n}{p_i\\cdot{q_i}}}{\\sum\\limits_{i=1}^{n}{p_i^2}+\\sum\\limits_{i=1}^{n}{q_i^2}-\\sum\\limits_{i=1}^{n}{p_i\\cdot{q_i}}}$\n\n- `dice(p,q)`\n\nReturns the [Dice distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\frac{\\sum\\limits_{i=1}^{n}{(p_i-q_i)^2}}{\\sum\\limits_{i=1}^{n}{p_i^2}+\\sum\\limits_{i=1}^{n}{q_i^2}}$\n\n- `fidelity(p, q)`\n\nReturns the [Fidelity similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{\\sqrt{p_i\\cdot{q_i}}}$\n\n- `bhattacharyya(p, q)`\n\nReturns the [Bhattacharyya distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=-\\ln\\left(\\sum\\limits_{i=1}^{n}{\\sqrt{p_i\\cdot{q_i}}}\\right)$\n\n- `hellinger(p, q)`\n\nReturns the [Hellinger distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=2\\cdot\\sqrt{1-\\sum\\limits_{i=1}^{n}{\\sqrt{p_i\\cdot{q_i}}}}$\n\n- `matusita(p, q)`\n\nReturns the [Matusita distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sqrt{2-2\\cdot\\sum\\limits_{i=1}^{n}{\\sqrt{p_i\\cdot{q_i}}}}$\n\n- `squaredChord(p, q)`\n\nReturns the [Squared-chord distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{(\\sqrt{p_i}-\\sqrt{q_i})^2}$\n\n- `squaredEuclidean(p, q)`\n\nReturns the [squared euclidean distance](http://en.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{(p_i-q_i)^2}$\n\n- `pearson(p, q)`\n\nReturns the [Pearson distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{\\frac{(p_i-q_i)^2}{q_i}}$\n\n- `neyman(p, q)`\n\nReturns the [Neyman distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{\\frac{(p_i-q_i)^2}{p_i}}$\n\n- `squared(p, q)`\n\nReturns the [Squared distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{\\frac{(p_i-q_i)^2}{p_i+q_i}}$\n\n- `probabilisticSymmetric(p, q)`\n\nReturns the [Probabilistic Symmetric distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=2\\cdot\\sum\\limits_{i=1}^{n}{\\frac{(p_i-q_i)^2}{p_i+q_i}}$\n\n- `divergence(p, q)`\n\nReturns the [Divergence distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=2\\cdot\\sum\\limits_{i=1}^{n}{\\frac{(p_i-q_i)^2}{(p_i+q_i)^2}}$\n\n- `clark(p, q)`\n\nReturns the [Clark distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sqrt{\\sum\\limits_{i=1}^{n}{\\left(\\frac{\\left|p_i-q_i\\right|}{(p_i+q_i)}\\right)^2}}$\n\n- `additiveSymmetric(p, q)`\n\nReturns the [Additive Symmetric distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{\\frac{(p_i-q_i)^2\\cdot(p_i+q_i)}{p_i\\cdot{q_i}}}$\n\n- `kullbackLeibler(p, q)`\n\nReturns the [Kullback-Leibler distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{p_i\\cdot\\ln\\frac{p_i}{q_i}}$\n\n- `jeffreys(p, q)`\n\nReturns the [Jeffreys distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{\\left((p_i-q_i)\\ln\\frac{p_i}{q_i}\\right)}$\n\n- `kdivergence(p, q)`\n\nReturns the [K divergence distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{\\left(p_i\\cdot\\ln\\frac{2p_i}{p_i+q_i}\\right)}$\n\n- `topsoe(p, q)`\n\nReturns the [Topsøe distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{\\left(p_i\\cdot\\ln\\frac{2p_i}{p_i+q_i}+q_i\\cdot\\ln\\frac{2q_i}{p_i+q_i}\\right)}$\n\n- `jensenShannon(p, q)`\n\nReturns the [Jensen-Shannon distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\frac{1}{2}\\left[\\sum\\limits_{i=1}^{n}{p_i\\cdot\\ln\\frac{2p_i}{p_i+q_i}}+\\sum\\limits_{i=1}^{n}{q_i\\cdot\\ln\\frac{2q_i}{p_i+q_i}}\\right]$\n\n- `jensenDifference(p, q)`\n\nReturns the [Jensen difference distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{\\left[\\frac{p_i\\ln{p_i}+q_i\\ln{q_i}}{2}-\\left(\\frac{p_i+q_i}{2}\\right)\\ln\\left(\\frac{p_i+q_i}{2}\\right)\\right]}$\n\n- `taneja(p, q)`\n\nReturns the [Taneja distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{\\left[\\frac{p_i+q_i}{2}\\ln\\left(\\frac{p_i+q_i}{2\\sqrt{p_i\\cdot{q_i}}}\\right)\\right]}$\n\n- `kumarJohnson(p, q)`\n\nReturns the [Kumar-Johnson distance](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$d(p,q)=\\sum\\limits_{i=1}^{n}{\\frac{\\left(p_i^2-q_i^2\\right)^2}{2(p_i\\cdot{q_i})^{3/2}}}$\n\n- `avg(p, q)`\n\nReturns the average of city block and Chebyshev distances between vectors p and q\n\n$d(p,q)=\\frac{\\sum\\limits_{i=1}^{n}{\\left|p_i-q_i\\right|}+\\max\\limits_i(|p_i-q_i|)}{2}$\n\n### Similarities\n\n- `intersection(p, q)`\n\nReturns the [Intersection similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n- `czekanowski(p, q)`\n\nReturns the [Czekanowski similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n- `motyka(p, q)`\n\nReturns the [Motyka similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n- `kulczynski(p, q)`\n\nReturns the [Kulczynski similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n- `squaredChord(p, q)`\n\nReturns the [Squared-chord similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n- `cosine(p, q)`\n\nReturns the [Cosine similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$s(p,q)=\\frac{\\sum\\limits_{i=1}^{n}{p_i\\cdot{q_i}}}{\\sqrt{\\sum\\limits_{i=1}^{n}{p_i^2}}\\sqrt{\\sum\\limits_{i=1}^{n}{q_i^2}}}$\n\n- `kumarHassebrook(p, q)`\n\nReturns the [Kumar-Hassebrook similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n$s(p,q)=\\frac{\\sum\\limits_{i=1}^{n}{p_i\\cdot{q_i}}}{\\sum\\limits_{i=1}^{n}{p_i^2}+\\sum\\limits_{i=1}^{n}{q_i^2}-\\sum\\limits_{i=1}^{n}{p_i\\cdot{q_i}}}$\n\n- `pearson(p, q)`\n\nReturns the [Pearson correlation](https://en.wikipedia.org/wiki/Pearson_correlation_coefficient) between vectors p and q, i.e. the cosine similarity of the mean-centred vectors\n\n- `ruzicka(p, q)`\n\nReturns the [Ruzicka similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf), also known as the [weighted Jaccard similarity](https://en.wikipedia.org/wiki/Jaccard_index#Weighted_Jaccard_similarity_and_distance), between vectors p and q. The matching distance is `soergel`.\n\n$s(p,q)=\\frac{\\sum\\limits_{i=1}^{n}{min(p_i,q_i)}}{\\sum\\limits_{i=1}^{n}{max(p_i,q_i)}}$\n\n- `dice(p, q)`\n\nReturns the [Dice similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\n\n- `tanimoto(p, q, [bitVector])`\n\nReturns the [Tanimoto similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q, and accepts the bitVector use, see the test case for an example\n\n- `tree(a,b, from, to, [options])`\n\nRefer to [ml-tree-similarity](https://github.com/mljs/tree-similarity)\n\n## Contributing\n\nA new metric should normally be in its own file in the `src/distances` (or `src/similarities`) directory. There should be a corresponding test file in the neighbouring `__tests__` directory.  \nThe metric should be then added in the exports of `src/distances.ts` (or `src/similarities.ts`) with a relatively small but understandable name (use camelCase).  \nIt should also be added to this README with either a link to the formula or an inline description.\n\n## Authors\n\n- [Michaël Zasso](https://github.com/targos)\n- [Miguel Angel Asencio Hurtado](https://github.com/maasencioh)\n\n## License\n\n[MIT](./LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/ml-distance.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/ml-distance\n[codecov-image]: https://img.shields.io/codecov/c/github/mljs/distance.svg\n[codecov-url]: https://codecov.io/gh/mljs/distance\n[download-image]: https://img.shields.io/npm/dm/ml-distance.svg?style=flat-square\n[download-url]: https://npmjs.org/package/ml-distance\n","publish_time":1673024939212,"_cnpm_publish_time":1673024939212,"dist-tags":{"latest":"5.0.0"}}