{"_id":"ml-distance","_rev":"3794212","name":"ml-distance","description":"Distance and similarity functions to compare vectors","dist-tags":{"latest":"4.0.1"},"maintainers":[{"name":"andcastillo","email":""},{"name":"cheminfo-bot","email":""},{"name":"jeffersonh44","email":""},{"name":"lpatiny","email":""},{"name":"maasencioh","email":""},{"name":"mljs-bot","email":""},{"name":"stropitek","email":""},{"name":"targos","email":""}],"time":{"modified":"2025-06-05T10:28:15.000Z","created":"2014-11-18T06:40:55.442Z","4.0.1":"2023-06-01T09:56:54.011Z","4.0.0":"2023-01-06T17:08:59.212Z","3.0.0":"2019-06-29T22:27:23.047Z","2.1.1":"2016-08-03T06:36:51.567Z","2.1.0":"2015-08-20T12:07:49.441Z","2.0.1":"2015-07-15T12:16:29.562Z","2.0.0":"2015-07-15T09:38:15.399Z","1.0.2":"2015-06-23T11:52:34.300Z","1.0.1":"2015-06-23T08:33:45.820Z","1.0.0":"2014-11-18T06:40:55.442Z"},"users":{},"author":{"name":"Michaël Zasso"},"repository":{"type":"git","url":"git+https://github.com/mljs/distance.git"},"versions":{"4.0.1":{"name":"ml-distance","version":"4.0.1","description":"Distance and similarity functions to compare vectors","main":"lib/index.js","module":"./lib-esm/index.js","types":"./lib/index.d.ts","scripts":{"check-types":"tsc --noEmit","clean":"rimraf lib lib-esm","eslint":"eslint src","eslint-fix":"npm run eslint -- --fix","prepack":"npm run tsc","prettier":"prettier --check src","prettier-write":"prettier --write src","test":"npm run test-coverage && npm run eslint && npm run check-types","test-only":"jest","test-coverage":"jest --coverage","tsc":"npm run clean && npm run tsc-cjs && npm run tsc-esm","tsc-cjs":"tsc --project tsconfig.cjs.json","tsc-esm":"tsc --project tsconfig.esm.json"},"repository":{"type":"git","url":"git+https://github.com/mljs/distance.git"},"keywords":["distance","similarity","metric","vector","data","mining","datamining","machine","learning"],"author":{"name":"Michaël Zasso"},"contributors":[{"name":"Miguel Asencio"}],"license":"MIT","bugs":{"url":"https://github.com/mljs/distance/issues"},"homepage":"https://github.com/mljs/distance","devDependencies":{"@babel/plugin-transform-modules-commonjs":"^7.20.7","@babel/preset-typescript":"^7.18.6","@types/jest":"^29.2.4","cheminfo-types":"^1.4.0","eslint":"^8.30.0","eslint-config-cheminfo-typescript":"^11.2.2","esm":"^3.2.25","jest":"^29.3.1","prettier":"^2.8.1","rimraf":"^3.0.2","typescript":"^4.9.4"},"dependencies":{"ml-array-mean":"^1.1.6","ml-distance-euclidean":"^2.0.0","ml-tree-similarity":"^1.0.0"},"gitHead":"6c01cb063ae50859cabc80ca505002162a003b77","_id":"ml-distance@4.0.1","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"shasum":"4741d17a1735888c5388823762271dfe604bd019","size":29375,"noattachment":false,"key":"/ml-distance/-/ml-distance-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ml-distance/download/ml-distance-4.0.1.tgz"},"_npmUser":{"name":"mljs-bot","email":"bot+npm-mljs@zakodium.com"},"directories":{},"maintainers":[{"name":"andcastillo","email":""},{"name":"cheminfo-bot","email":""},{"name":"jeffersonh44","email":""},{"name":"lpatiny","email":""},{"name":"maasencioh","email":""},{"name":"mljs-bot","email":""},{"name":"stropitek","email":""},{"name":"targos","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ml-distance_4.0.1_1685613413754_0.4809814322442656"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-06-01T09:56:54.011Z","publish_time":1685613414011,"_source_registry_name":"default","_cnpm_publish_time":1685613414011},"4.0.0":{"name":"ml-distance","version":"4.0.0","description":"Distance and similarity functions to compare vectors","main":"lib/index.js","module":"./lib-esm/index.js","types":"./lib/index.d.ts","scripts":{"check-types":"tsc --noEmit","clean":"rimraf lib lib-esm","eslint":"eslint src","eslint-fix":"npm run eslint -- --fix","prepack":"npm run tsc","prettier":"prettier --check src","prettier-write":"prettier --write src","test":"npm run test-coverage && npm run eslint && npm run check-types","test-only":"jest","test-coverage":"jest --coverage","tsc":"npm run clean && npm run tsc-cjs && npm run tsc-esm","tsc-cjs":"tsc --project tsconfig.cjs.json","tsc-esm":"tsc --project tsconfig.esm.json"},"repository":{"type":"git","url":"git+https://github.com/mljs/distance.git"},"keywords":["distance","similarity","metric","vector","data","mining","datamining","machine","learning"],"author":{"name":"Michaël Zasso"},"contributors":[{"name":"Miguel Asencio"}],"license":"MIT","bugs":{"url":"https://github.com/mljs/distance/issues"},"homepage":"https://github.com/mljs/distance","devDependencies":{"@babel/plugin-transform-modules-commonjs":"^7.20.7","@babel/preset-typescript":"^7.18.6","@types/jest":"^29.2.4","cheminfo-types":"^1.4.0","eslint":"^8.30.0","eslint-config-cheminfo-typescript":"^11.2.2","esm":"^3.2.25","jest":"^29.3.1","prettier":"^2.8.1","rimraf":"^3.0.2","typescript":"^4.9.4"},"dependencies":{"ml-array-mean":"^1.1.6","ml-distance-euclidean":"^2.0.0","ml-tree-similarity":"^1.0.0"},"gitHead":"cbfe008c34e8334ffb4823a367926ca63060494f","_id":"ml-distance@4.0.0","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"shasum":"197c272abea03f13e1746e59a35be4491566bfdc","size":29255,"noattachment":false,"key":"/ml-distance/-/ml-distance-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ml-distance/download/ml-distance-4.0.0.tgz"},"_npmUser":{"name":"mljs-bot","email":"bot+npm-mljs@zakodium.com"},"directories":{},"maintainers":[{"name":"andcastillo","email":""},{"name":"cheminfo-bot","email":""},{"name":"jeffersonh44","email":""},{"name":"lpatiny","email":""},{"name":"maasencioh","email":""},{"name":"mljs-bot","email":""},{"name":"stropitek","email":""},{"name":"targos","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ml-distance_4.0.0_1673024939053_0.2562466777411747"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-06T17:16:28.181Z","publish_time":1673024939212,"_cnpm_publish_time":1673024939212},"3.0.0":{"name":"ml-distance","version":"3.0.0","description":"Distance and similarity functions to compare vectors","main":"lib/index.js","module":"src/index.js","scripts":{"compile":"rollup -c","eslint":"eslint src","eslint-fix":"npm run eslint -- --fix","prepublishOnly":"npm run compile","test":"npm run test-coverage && npm run eslint","test-only":"jest","test-coverage":"jest --coverage"},"repository":{"type":"git","url":"git+https://github.com/mljs/distance.git"},"keywords":["distance","similarity","metric","vector","data","mining","datamining","machine","learning"],"author":{"name":"Michaël Zasso"},"contributors":[{"name":"Miguel Asencio"}],"license":"MIT","bugs":{"url":"https://github.com/mljs/distance/issues"},"homepage":"https://github.com/mljs/distance","devDependencies":{"@babel/plugin-transform-modules-commonjs":"^7.4.4","eslint":"^6.0.1","eslint-config-cheminfo":"^1.20.1","eslint-plugin-import":"^2.18.0","eslint-plugin-jest":"^22.7.1","jest":"^24.8.0","rollup":"^1.16.3"},"dependencies":{"ml-array-mean":"^1.1.1","ml-distance-euclidean":"^2.0.0","ml-tree-similarity":"^1.0.0"},"gitHead":"22b7af1df536ea32b06f3e5ed3f7fa3523f67ee7","_id":"ml-distance@3.0.0","_nodeVersion":"12.5.0","_npmVersion":"6.9.0","dist":{"shasum":"0e49c525480b21c28a3fbcdc4577f063341dfecf","size":7963,"noattachment":false,"key":"/ml-distance/-/ml-distance-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ml-distance/download/ml-distance-3.0.0.tgz"},"maintainers":[{"name":"andcastillo","email":""},{"name":"cheminfo-bot","email":""},{"name":"jeffersonh44","email":""},{"name":"lpatiny","email":""},{"name":"maasencioh","email":""},{"name":"mljs-bot","email":""},{"name":"stropitek","email":""},{"name":"targos","email":""}],"_npmUser":{"name":"targos","email":"targos+npm@protonmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ml-distance_3.0.0_1561847242938_0.2663498431382765"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-24T06:42:12.392Z","publish_time":1561847243047,"_cnpm_publish_time":1561847243047},"2.1.1":{"name":"ml-distance","version":"2.1.1","description":"Distance and similarity functions to compare vectors","main":"src/index.js","directories":{"lib":"src","test":"test"},"scripts":{"test":"mocha --require should --reporter mocha-better-spec-reporter --recursive"},"repository":{"type":"git","url":"git+https://github.com/mljs/distance.git"},"keywords":["distance","similarity","metric","vector","data","mining","datamining","machine","learning"],"author":{"name":"Michaël Zasso"},"contributors":[{"name":"Miguel Asencio"}],"license":"MIT","bugs":{"url":"https://github.com/mljs/distance/issues"},"homepage":"https://github.com/mljs/distance","devDependencies":{"mocha":"^3.0.0","mocha-better-spec-reporter":"^3.0.2","should":"^10.0.0"},"dependencies":{"ml-distance-euclidean":"^1.0.0","ml-stat":"^1.0.1","ml-tree-similarity":"^0.0.0"},"gitHead":"b344cb49460cfa7a4ef3761a81f68b912b4955e0","_id":"ml-distance@2.1.1","_shasum":"f6cc1f2970819cb42e68c68de363309ba3bd079f","_from":".","_npmVersion":"3.10.5","_nodeVersion":"6.3.1","_npmUser":{"name":"targos","email":"targos@live.com"},"maintainers":[{"name":"andcastillo","email":""},{"name":"cheminfo-bot","email":""},{"name":"jeffersonh44","email":""},{"name":"lpatiny","email":""},{"name":"maasencioh","email":""},{"name":"mljs-bot","email":""},{"name":"stropitek","email":""},{"name":"targos","email":""}],"dist":{"shasum":"f6cc1f2970819cb42e68c68de363309ba3bd079f","size":6508,"noattachment":false,"key":"/ml-distance/-/ml-distance-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ml-distance/download/ml-distance-2.1.1.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ml-distance-2.1.1.tgz_1470206210232_0.28762899641878903"},"_cnpmcore_publish_time":"2021-12-24T06:42:11.491Z","publish_time":1470206211567,"_cnpm_publish_time":1470206211567},"2.1.0":{"name":"ml-distance","version":"2.1.0","description":"Distance and similarity functions to compare vectors","main":"src/index.js","directories":{"lib":"src","test":"test"},"scripts":{"test":"mocha --require should --reporter mocha-better-spec-reporter --recursive"},"repository":{"type":"git","url":"git+https://github.com/mljs/distance.git"},"keywords":["distance","similarity","metric","vector","data","mining","datamining","machine","learning"],"author":{"name":"Michaël Zasso"},"contributors":[{"name":"Miguel Asencio"}],"license":"MIT","bugs":{"url":"https://github.com/mljs/distance/issues"},"homepage":"https://github.com/mljs/distance","devDependencies":{"mocha":"^2.2.5","mocha-better-spec-reporter":"^2.1.1","should":"^7.0.2"},"dependencies":{"ml-euclidean-distance":"^1.0.0","ml-stat":"^1.0.1","ml-tree-similarity":"^0.0.0"},"gitHead":"6d9fd814065b7dadd2aa6b80604655dc6c6d377c","_id":"ml-distance@2.1.0","_shasum":"03ded734cf880ffffee9c888d63b32d78fc4b893","_from":".","_npmVersion":"2.13.0","_nodeVersion":"2.4.0","_npmUser":{"name":"lpatiny","email":"lpatiny@gmail.com"},"dist":{"shasum":"03ded734cf880ffffee9c888d63b32d78fc4b893","size":6457,"noattachment":false,"key":"/ml-distance/-/ml-distance-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ml-distance/download/ml-distance-2.1.0.tgz"},"maintainers":[{"name":"andcastillo","email":""},{"name":"cheminfo-bot","email":""},{"name":"jeffersonh44","email":""},{"name":"lpatiny","email":""},{"name":"maasencioh","email":""},{"name":"mljs-bot","email":""},{"name":"stropitek","email":""},{"name":"targos","email":""}],"_cnpmcore_publish_time":"2021-12-24T06:42:10.606Z","publish_time":1440072469441,"_cnpm_publish_time":1440072469441},"2.0.1":{"name":"ml-distance","version":"2.0.1","description":"Distance and similarity functions to compare vectors","main":"src/index.js","directories":{"lib":"src","test":"test"},"scripts":{"test":"mocha --require should --reporter mocha-better-spec-reporter --recursive"},"repository":{"type":"git","url":"git+https://github.com/mljs/distance.git"},"keywords":["distance","similarity","metric","vector","data","mining","datamining","machine","learning"],"author":{"name":"Michaël Zasso"},"contributors":[{"name":"Miguel Asencio"}],"license":"MIT","bugs":{"url":"https://github.com/mljs/distance/issues"},"homepage":"https://github.com/mljs/distance","devDependencies":{"mocha":"^2.2.5","mocha-better-spec-reporter":"^2.1.1","should":"^7.0.2"},"dependencies":{"ml-euclidean-distance":"^1.0.0","ml-tree-similarity":"^0.0.0"},"gitHead":"9d497cdab3356f9f695642fe255ccaf0274fd176","_id":"ml-distance@2.0.1","_shasum":"0cb4ffcb66c365da501a05748a19460a0435c03c","_from":".","_npmVersion":"2.11.0","_nodeVersion":"2.2.1","_npmUser":{"name":"maasencioh","email":"maasencioh@gmail.com"},"dist":{"shasum":"0cb4ffcb66c365da501a05748a19460a0435c03c","size":6300,"noattachment":false,"key":"/ml-distance/-/ml-distance-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ml-distance/download/ml-distance-2.0.1.tgz"},"maintainers":[{"name":"andcastillo","email":""},{"name":"cheminfo-bot","email":""},{"name":"jeffersonh44","email":""},{"name":"lpatiny","email":""},{"name":"maasencioh","email":""},{"name":"mljs-bot","email":""},{"name":"stropitek","email":""},{"name":"targos","email":""}],"_cnpmcore_publish_time":"2021-12-24T06:42:09.730Z","publish_time":1436962589562,"_cnpm_publish_time":1436962589562},"2.0.0":{"name":"ml-distance","version":"2.0.0","description":"Distance and similarity functions to compare vectors","main":"src/index.js","directories":{"lib":"src","test":"test"},"scripts":{"test":"mocha --require should --reporter mocha-better-spec-reporter --recursive"},"repository":{"type":"git","url":"git+https://github.com/mljs/distance.git"},"keywords":["distance","similarity","metric","vector","data","mining","datamining","machine","learning"],"author":{"name":"Michaël Zasso"},"contributors":[{"name":"Miguel Asencio"}],"license":"MIT","bugs":{"url":"https://github.com/mljs/distance/issues"},"homepage":"https://github.com/mljs/distance","devDependencies":{"mocha":"^2.2.5","mocha-better-spec-reporter":"^2.1.1","should":"^7.0.2"},"dependencies":{"ml-euclidean-distance":"^1.0.0"},"gitHead":"b372341349da653a3396f9b5c15382ed1fbc6d25","_id":"ml-distance@2.0.0","_shasum":"c6a0725e95de4e640ec0314fe80c31c68ea7093d","_from":".","_npmVersion":"2.11.0","_nodeVersion":"2.2.1","_npmUser":{"name":"maasencioh","email":"maasencioh@gmail.com"},"dist":{"shasum":"c6a0725e95de4e640ec0314fe80c31c68ea7093d","size":7784,"noattachment":false,"key":"/ml-distance/-/ml-distance-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ml-distance/download/ml-distance-2.0.0.tgz"},"maintainers":[{"name":"andcastillo","email":""},{"name":"cheminfo-bot","email":""},{"name":"jeffersonh44","email":""},{"name":"lpatiny","email":""},{"name":"maasencioh","email":""},{"name":"mljs-bot","email":""},{"name":"stropitek","email":""},{"name":"targos","email":""}],"_cnpmcore_publish_time":"2021-12-24T06:42:08.854Z","publish_time":1436953095399,"_cnpm_publish_time":1436953095399},"1.0.2":{"name":"ml-distance","version":"1.0.2","description":"Distance and similarity functions to compare vectors","main":"src/index.js","directories":{"lib":"src","test":"test"},"scripts":{"test":"mocha --require should --reporter mocha-better-spec-reporter --recursive"},"repository":{"type":"git","url":"git+https://github.com/mljs/distance.git"},"keywords":["distance","similarity","metric","vector","data","mining","datamining","machine","learning"],"author":"","license":"MIT","bugs":{"url":"https://github.com/mljs/distance/issues"},"homepage":"https://github.com/mljs/distance","devDependencies":{"browserify":"^8.1.3","del":"^1.1.1","gulp":"^3.8.11","gulp-bump":"^0.1.11","gulp-git":"^0.5.3","gulp-header":"^1.2.2","gulp-rename":"^1.2.0","gulp-sourcemaps":"^1.3.0","gulp-size":"^1.1.0","gulp-uglify":"^1.1.0","mocha":"latest","mocha-better-spec-reporter":"latest","should":"latest","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.0.0","yargs":"^1.3.2"},"gitHead":"e440cb768fa87b0be23b0311f9cb176bac58ceab","_id":"ml-distance@1.0.2","_shasum":"8eb2dc9a5daf4e66c3213a1fac207de1c5e08b44","_from":".","_npmVersion":"2.11.0","_nodeVersion":"2.2.1","_npmUser":{"name":"maasencioh","email":"maasencioh@gmail.com"},"dist":{"shasum":"8eb2dc9a5daf4e66c3213a1fac207de1c5e08b44","size":8239,"noattachment":false,"key":"/ml-distance/-/ml-distance-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/ml-distance/download/ml-distance-1.0.2.tgz"},"maintainers":[{"name":"andcastillo","email":""},{"name":"cheminfo-bot","email":""},{"name":"jeffersonh44","email":""},{"name":"lpatiny","email":""},{"name":"maasencioh","email":""},{"name":"mljs-bot","email":""},{"name":"stropitek","email":""},{"name":"targos","email":""}],"_cnpmcore_publish_time":"2021-12-24T06:42:07.975Z","publish_time":1435060354300,"_cnpm_publish_time":1435060354300},"1.0.1":{"name":"ml-distance","version":"1.0.1","description":"Distance and similarity functions to compare vectors","main":"src/index.js","directories":{"lib":"src","test":"test"},"scripts":{"test":"mocha --require should --reporter mocha-better-spec-reporter --recursive"},"repository":{"type":"git","url":"git+https://github.com/mljs/distance.git"},"keywords":["distance","similarity","metric","vector","data","mining","datamining","machine","learning"],"author":"","license":"MIT","bugs":{"url":"https://github.com/mljs/distance/issues"},"homepage":"https://github.com/mljs/distance","devDependencies":{"browserify":"^8.1.3","del":"^1.1.1","gulp":"^3.8.11","gulp-bump":"^0.1.11","gulp-git":"^0.5.3","gulp-header":"^1.2.2","gulp-rename":"^1.2.0","gulp-sourcemaps":"^1.3.0","gulp-size":"^1.1.0","gulp-uglify":"^1.1.0","mocha":"latest","mocha-better-spec-reporter":"latest","should":"latest","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.0.0","yargs":"^1.3.2"},"gitHead":"02f780540a2e2dc57d284092e71d0ccc0344498a","_id":"ml-distance@1.0.1","_shasum":"5c2f1b0b5feb0df0837429aca8f1450ddd96d536","_from":".","_npmVersion":"2.11.0","_nodeVersion":"2.2.1","_npmUser":{"name":"maasencioh","email":"maasencioh@gmail.com"},"dist":{"shasum":"5c2f1b0b5feb0df0837429aca8f1450ddd96d536","size":7797,"noattachment":false,"key":"/ml-distance/-/ml-distance-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ml-distance/download/ml-distance-1.0.1.tgz"},"maintainers":[{"name":"andcastillo","email":""},{"name":"cheminfo-bot","email":""},{"name":"jeffersonh44","email":""},{"name":"lpatiny","email":""},{"name":"maasencioh","email":""},{"name":"mljs-bot","email":""},{"name":"stropitek","email":""},{"name":"targos","email":""}],"_cnpmcore_publish_time":"2021-12-24T06:42:07.108Z","publish_time":1435048425820,"_cnpm_publish_time":1435048425820},"1.0.0":{"name":"ml-distance","version":"1.0.0","description":"Distance and similarity functions to compare vectors","main":"src/index.js","directories":{"lib":"src","test":"test"},"scripts":{"test":"mocha --require should-approximately-deep --reporter mocha-better-spec-reporter --recursive"},"repository":{"type":"git","url":"https://github.com/mljs/distance"},"keywords":["distance","similarity","metric","vector","data","mining","datamining","machine","learning"],"contributors":[{"name":"Miguel Angel Asencio Hurtado"},{"name":"Michaël Zasso"}],"license":"MIT","bugs":{"url":"https://github.com/mljs/distance/issues"},"homepage":"https://github.com/mljs/distance","devDependencies":{"mocha-better-spec-reporter":"latest","mocha":"latest","should":"latest"},"gitHead":"5684b91489bdb866bbc99d4155e9864fa94200e4","_id":"ml-distance@1.0.0","_shasum":"bccad4c55ecdac667796a88fc1baf7ceb40b2e9d","_from":".","_npmVersion":"2.0.0-beta.2","_npmUser":{"name":"targos","email":"targos@live.com"},"maintainers":[{"name":"andcastillo","email":""},{"name":"cheminfo-bot","email":""},{"name":"jeffersonh44","email":""},{"name":"lpatiny","email":""},{"name":"maasencioh","email":""},{"name":"mljs-bot","email":""},{"name":"stropitek","email":""},{"name":"targos","email":""}],"dist":{"shasum":"bccad4c55ecdac667796a88fc1baf7ceb40b2e9d","size":8221,"noattachment":false,"key":"/ml-distance/-/ml-distance-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ml-distance/download/ml-distance-1.0.0.tgz"},"_cnpmcore_publish_time":"2021-12-24T06:42:06.235Z","publish_time":1416292855442,"_cnpm_publish_time":1416292855442}},"readme":"# ml-distance\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![npm download][download-image]][download-url]\n\nDistance functions to compare vectors.\n\n## Installation\n\n`$ npm i ml-distance`\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|}}{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|}}{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- `ruzicka(p, q)`\n\nReturns the [Ruzicka similarity](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}{max(p_i,q_i)}}{\\sum\\limits_{i=1}^{n}{min(p_i,q_i)}}$\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- `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$d(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}}$\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$d(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- `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)=1-\\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- `jaccard(p, q)`\n\nReturns the [Jaccard similarity](http://www.naun.org/main/NAUN/ijmmas/mmmas-49.pdf) between vectors p and q\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/dist directory. There should be a corresponding test file in test/dist.  \nThe metric should be then added in the exports of src/index.js 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[travis-image]: https://img.shields.io/travis/mljs/distance/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/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","_attachments":{},"homepage":"https://github.com/mljs/distance","bugs":{"url":"https://github.com/mljs/distance/issues"},"license":"MIT"}