{"id":19267028,"url":"https://github.com/mljs/tree-similarity","last_synced_at":"2025-07-18T14:39:34.612Z","repository":{"id":35025674,"uuid":"39132852","full_name":"mljs/tree-similarity","owner":"mljs","description":"Tree similarity in Javascript","archived":false,"fork":false,"pushed_at":"2024-10-17T12:00:47.000Z","size":1320,"stargazers_count":8,"open_issues_count":4,"forks_count":1,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-04-16T04:45:56.645Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mljs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-15T11:20:19.000Z","updated_at":"2024-10-17T12:00:51.000Z","dependencies_parsed_at":"2024-06-18T22:38:19.495Z","dependency_job_id":"b9ed39b2-1f76-400b-a3fe-f7babcc7c578","html_url":"https://github.com/mljs/tree-similarity","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Ftree-similarity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Ftree-similarity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Ftree-similarity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Ftree-similarity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mljs","download_url":"https://codeload.github.com/mljs/tree-similarity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253668096,"owners_count":21944982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T20:09:31.557Z","updated_at":"2025-05-12T03:32:07.696Z","avatar_url":"https://github.com/mljs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tree-similarity\n\n[![NPM version][npm-image]][npm-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![npm download][download-image]][download-url]\n\nCompares two spectra using a tree similarity.\n\n## Installation\n\n`$ npm i ml-tree-similarity`\n\n## Usage\n\n```js\nimport { createTree, treeSimilarity } from 'ml-tree-similarity';\n\nconst a = {\n  x: [1, 2, 3, 4, 5, 6, 7],\n  y: [0.3, 0.7, 4, 0.3, 0.2, 5, 0.3],\n};\nconst b = {\n  x: [1, 2, 3, 4, 5, 6, 7],\n  y: [0.3, 4, 0.7, 0.3, 5, 0.2, 0.3],\n};\n\n// create a tree\nconst options = { from: 1, to: 7 };\nconst aTree = createTree(a, options);\nconst bTree = createTree(b, options);\n\nconst ans = treeSimilarity(aTree, bTree, options);\n```\n\n## [API Documentation](https://mljs.github.io/tree-similarity/)\n\nThis algorithm was based in the following papers:\n\n- [A new method for the comparison of 1H NMR predictors based on tree-similarity of spectra](https://doi.org/10.1186/1758-2946-6-9)\n- [Fast and shift-insensitive similarity comparisons of NMR using a tree-representation of spectra](https://doi.org/10.1016/j.chemolab.2013.05.009)\n\n## License\n\n[MIT](./LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/ml-tree-similarity.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/ml-tree-similarity\n[codecov-image]: https://img.shields.io/codecov/c/github/mljs/tree-similarity.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/mljs/tree-similarity\n[download-image]: https://img.shields.io/npm/dm/ml-tree-similarity.svg?style=flat-square\n[download-url]: https://npmjs.org/package/ml-tree-similarity\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Ftree-similarity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmljs%2Ftree-similarity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Ftree-similarity/lists"}