{"id":34501915,"url":"https://github.com/machinelearnjs/libsvm-ts","last_synced_at":"2026-03-14T07:02:07.290Z","repository":{"id":46058176,"uuid":"183752504","full_name":"machinelearnjs/libsvm-ts","owner":"machinelearnjs","description":"libsvm in Typescript for machinelearn.js","archived":false,"fork":false,"pushed_at":"2025-02-23T23:12:51.000Z","size":1504,"stargazers_count":4,"open_issues_count":6,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-06T23:51:57.512Z","etag":null,"topics":["libsvm","machinelearning","svm","typescript"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/machinelearnjs.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-27T09:18:01.000Z","updated_at":"2025-02-23T23:12:55.000Z","dependencies_parsed_at":"2022-09-23T07:10:15.478Z","dependency_job_id":null,"html_url":"https://github.com/machinelearnjs/libsvm-ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/machinelearnjs/libsvm-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinelearnjs%2Flibsvm-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinelearnjs%2Flibsvm-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinelearnjs%2Flibsvm-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinelearnjs%2Flibsvm-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/machinelearnjs","download_url":"https://codeload.github.com/machinelearnjs/libsvm-ts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinelearnjs%2Flibsvm-ts/sbom","scorecard":{"id":609461,"data":{"date":"2025-08-11","repo":{"name":"github.com/machinelearnjs/libsvm-ts","commit":"d40c40bcd9dfcc666b8820504cfec0a40332d414"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":0.5,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":0,"reason":"binaries present in source code","details":["Warn: binary detected: libsvm/java/libsvm.jar:1","Warn: binary detected: libsvm/windows/libsvm.dll:1","Warn: binary detected: libsvm/windows/libsvmread.mexw64:1","Warn: binary detected: libsvm/windows/libsvmwrite.mexw64:1","Warn: binary detected: libsvm/windows/svm-predict.exe:1","Warn: binary detected: libsvm/windows/svm-scale.exe:1","Warn: binary detected: libsvm/windows/svm-toy.exe:1","Warn: binary detected: libsvm/windows/svm-train.exe:1","Warn: binary detected: libsvm/windows/svmpredict.mexw64:1","Warn: binary detected: libsvm/windows/svmtrain.mexw64:1","Warn: binary detected: out/asm/libsvm.wasm:1","Warn: binary detected: out/wasm/libsvm.wasm:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"168 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-rvg8-pwq2-xj7q","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-3wcq-x3mq-6r9p","Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-6h5x-7c5m-7cr7","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-8mmm-9v2q-x3f9","Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-6x33-pw7p-hmpq","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-6c3j-c64m-qhgq","Warn: Project is vulnerable to: GHSA-gxr4-xjj5-5px2","Warn: Project is vulnerable to: GHSA-jpcq-cgw6-v4j6","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-pp57-mqmh-44h7","Warn: Project is vulnerable to: GHSA-p9wx-2529-fp83","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-wrvr-8mpx-r7pp","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-hxcm-v35h-mg2x","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-c9g6-9335-x697","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-mxhp-79qh-mcx6","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-662x-fhqg-9p8v","Warn: Project is vulnerable to: GHSA-394c-5j6w-4xmx","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq","Warn: Project is vulnerable to: GHSA-pv4c-p2j5-38j4","Warn: Project is vulnerable to: GHSA-46c4-8wrp-j99v","Warn: Project is vulnerable to: GHSA-9m6j-fcg5-2442","Warn: Project is vulnerable to: GHSA-hh27-ffr2-f2jc","Warn: Project is vulnerable to: GHSA-rqff-837h-mm52","Warn: Project is vulnerable to: GHSA-8v38-pw62-9cw2","Warn: Project is vulnerable to: GHSA-hgjh-723h-mx2j","Warn: Project is vulnerable to: GHSA-jf5r-8hm2-f872","Warn: Project is vulnerable to: GHSA-pgr8-jg6h-8gw6","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-cf66-xwfp-gvc4","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-g78m-2chm-r7qv","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp","Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-xf5p-87ch-gxw2","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-78cj-fxph-m83p","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T02:17:47.711Z","repository_id":46058176,"created_at":"2025-08-21T02:17:47.711Z","updated_at":"2025-08-21T02:17:47.711Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27992996,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["libsvm","machinelearning","svm","typescript"],"created_at":"2025-12-24T02:04:56.365Z","updated_at":"2025-12-24T02:04:57.058Z","avatar_url":"https://github.com/machinelearnjs.png","language":"C++","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://i.imgur.com/eNePt87.png\" /\u003e\n\u003c/p\u003e\n\n[![Build Status](https://dev.azure.com/jasonShin91/machinelearn.js/_apis/build/status/machinelearnjs.libsvm-ts?branchName=master)](https://dev.azure.com/jasonShin91/machinelearn.js/_build/latest?definitionId=2\u0026branchName=master)\n[![NPM version][npm-image]][npm-url]\n[![npm download][download-image]][download-url]\n\n# [DEMO](https://mljs.github.io/libsvm/)\n\nPort of libsvm v3.22 using [emscripten](https://github.com/kripken/emscripten) and it targets browser or nodejs using asm and WebAssembly.\n\nWhat is libsvm?\nlibsvm is a [c++ library](https://github.com/cjlin1/libsvm) developped by Chih-Chung Chang and Chih-Jen Lin that allows to do support vector machine (aka SVM) classification and regression.\n\nResources about libsvm:\n- [libsvm website](https://www.csie.ntu.edu.tw/~cjlin/libsvm/)\n- [libsvm github repository](https://github.com/cjlin1/libsvm)\n- [Wikipedia article](https://en.wikipedia.org/wiki/Support_vector_machine)\n- Chih-Chung Chang and Chih-Jen Lin, LIBSVM : a library for support vector machines. ACM Transactions on Intelligent Systems and Technology, 2:27:1--27:27, 2011.\n\n\n\n# Usage\n## Install using npm\n```bash\nnpm install libsvm-ts\n```\n\n## Install using yarn\n```bash\nyarn add libsvm-ts\n```\n\n## Load in nodejs\nThe main entry point loads the WebAssembly build and is asynchronous.\n\n```typescript\nimport { SVM } from 'libsvm-ts';\nconst svm = new SVM(); // ...\n```\n\n## Load in the browser\nThe npm package contains a bundle for the browser that works with AMD and browser globals. There is one bundle for the asm build and another for the web assembly build. They are located in the `dist/browser` directory of the package. You can load them into your web page with a `script` tag. For the web assembly module, make sure that the libsvm.wasm file is served from the same relative path as the js file.\n\n## Basic usage\nThis example illustrates how to use the library to train and use an SVM classifier.\n```typescript\nimport { SVM } from 'libsvm-ts';\n\nconst svm = new SVM({\n  type: 'C_SVC',\n  kernel: 'RBF',\n  gamma: 1,\n  cost: 1\n});\n\n// This is the xor problem\n//  1  0\n//  0  1\nconst samples = [[0, 0], [1, 1], [1, 0], [0, 1]];\nconst labels = [0, 0, 1, 1];\n\nsvm.loadWASM().then((loadedSVM) =\u003e {\n  // Also you can loadASM() instead of loadWASM()\n  loadedSVM.train({ samples, labels });\n  const predictedLabel = loadedSVM.predictOne({ sample: [0.7, 0.8] });\n  console.log(predictedLabel) // 0\n});\n```\n\n# Development \n\nWe welcome new contributors of all level of experience. The development guide will be added to assist new contributors to easily join the project.\n\n- You want to participate in a Machine Learning project, which will boost your Machine Learning skills and knowledge\n- Looking to be part of a growing community\n- You want to learn Machine Learning\n- You like Typescript ❤️ Machine Learning\n\nCheckout `CONTRIBUTIONS.md` for more information\n\n# Benchmarks\nYou can compare the performance of the library in various environments. Run `npm run benchmark` to run the benchmarks with native c/c++ code and with the compiled code with your local version of node.js. For browser performance, go to the [web benchmark page](https://mljs.github.io/libsvm/#benchmarks).\n\nSpeed is mainly affected by the javascript engine that compiles it. Since WebAssembly has been stabilized and is an optimization phase, more recent engines are almost always faster.\n\nSpeed is also affected by the version of emscripten that generated the build or the options used in the build. I will try to keep up with any improvement that might significantly impact the performance.\n\n## Cross-validation benchmark\nI report the results here for the cross-validation benchmark on the iris dataset to get a feeling for how performance compares on different platforms. There are other benchmarks that can be run from the terminal in node.js or in the browser. The performance results are given relative to how they run natively (with compiled c++ code). The benchmarks only consider runtime performance, not load and parse performance.\n\n| Platform | Rel asm perf | Rel wasm perf |\n| --- | --- | --- |\n| Native | 100% | 100% |\n| Node.js 8.1.2 | 34.2% | 52.6% |\n| Node.js v7.10.0 | 14.4% | N/A |\n| Chrome 59.0.3071.115  | 36.2% | 51.3% |\n| Firefox 54.0 | 35.5% | 70.4% |\n\n\n# What are asm and WebAssembly ?\nFrom [asmjs.org](http;//asmjs.org)\n\u003e asm is an optimizable subset of javascript.\n\nFrom [webassembly.org](http://webassembly.org)\n\u003e WebAssembly or wasm is a new portable, size- and load-time-efficient format suitable for compilation to the web\n\n# Should I use asm or WebAssembly ?\nBoth. You should try to use WebAssembly first and fall back to asm in order to support all browsers.\n\nWebAssembly is currently supported in the latest stable versions of Chrome, Firefox and on preview versions of Safari and Edge.\n\n# API Documentation\n\u003ca name=\"SVM\"\u003e\u003c/a\u003e\n\n## SVM\n**Kind**: global class  \n\n* [SVM](#SVM)\n    * [new SVM(options)](#new_SVM_new)\n    * _instance_\n        * [.train(samples, labels)](#SVM+train)\n        * [.crossValidation(samples, labels, kFold)](#SVM+crossValidation) ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\n        * [.free()](#SVM+free)\n        * [.predictOne(sample)](#SVM+predictOne) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n        * [.predict(samples)](#SVM+predict) ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\n        * [.predictProbability(samples)](#SVM+predictProbability) ⇒ \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e\n        * [.predictOneProbability(sample)](#SVM+predictOneProbability) ⇒ \u003ccode\u003eobject\u003c/code\u003e\n        * [.predictOneInterval(sample, confidence)](#SVM+predictOneInterval) ⇒ \u003ccode\u003eobject\u003c/code\u003e\n        * [.predictInterval(samples, confidence)](#SVM+predictInterval) ⇒ \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e\n        * [.getLabels()](#SVM+getLabels) ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\n        * [.getSVIndices()](#SVM+getSVIndices) ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\n        * [.serializeModel()](#SVM+serializeModel) ⇒ \u003ccode\u003estring\u003c/code\u003e\n    * _static_\n        * [.SVM_TYPES](#SVM.SVM_TYPES) : \u003ccode\u003eObject\u003c/code\u003e\n        * [.KERNEL_TYPES](#SVM.KERNEL_TYPES) : \u003ccode\u003eObject\u003c/code\u003e\n        * [.load(serializedModel)](#SVM.load) ⇒ [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)\n\n\u003ca name=\"new_SVM_new\"\u003e\u003c/a\u003e\n\n### new SVM(options)\n\n| Param | Type | Default | Description |\n| --- | --- | --- | --- |\n| options | \u003ccode\u003eobject\u003c/code\u003e |  |  |\n| [options.type] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003eSVM_TYPES.C_SVC\u003c/code\u003e | Type of SVM to perform, |\n| [options.kernel] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003eKERNEL_TYPES.RBF\u003c/code\u003e | Kernel function, |\n| [options.degree] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e3\u003c/code\u003e | Degree of polynomial, for polynomial kernel |\n| [options.gamma] | \u003ccode\u003enumber\u003c/code\u003e |  | Gamma parameter of the RBF, Polynomial and Sigmoid kernels. Default value is 1/num_features |\n| [options.coef0] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e0\u003c/code\u003e | coef0 parameter for Polynomial and Sigmoid kernels |\n| [options.cost] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e1\u003c/code\u003e | Cost parameter, for C SVC, Epsilon SVR and NU SVR |\n| [options.nu] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e0.5\u003c/code\u003e | For NU SVC and NU SVR |\n| [options.epsilon] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e0.1\u003c/code\u003e | For epsilon SVR |\n| [options.cacheSize] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e100\u003c/code\u003e | Cache size in MB |\n| [options.tolerance] | \u003ccode\u003enumber\u003c/code\u003e | \u003ccode\u003e0.001\u003c/code\u003e | Tolerance |\n| [options.shrinking] | \u003ccode\u003eboolean\u003c/code\u003e | \u003ccode\u003etrue\u003c/code\u003e | Use shrinking euristics (faster), |\n| [options.probabilityEstimates] | \u003ccode\u003eboolean\u003c/code\u003e | \u003ccode\u003efalse\u003c/code\u003e | weather to train SVC/SVR model for probability estimates, |\n| [options.weight] | \u003ccode\u003eobject\u003c/code\u003e |  | Set weight for each possible class |\n| [options.quiet] | \u003ccode\u003eboolean\u003c/code\u003e | \u003ccode\u003etrue\u003c/code\u003e | Print info during training if false |\n\n\u003ca name=\"SVM+train\"\u003e\u003c/a\u003e\n\n### svM.train(samples, labels)\nTrains the SVM model.\n\n**Kind**: instance method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Throws**:\n\n- if SVM instance was instantiated from SVM.load.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| samples | \u003ccode\u003eArray.\u0026lt;Array.\u0026lt;number\u0026gt;\u0026gt;\u003c/code\u003e | The training samples. First level of array are the samples, second level are the individual features |\n| labels | \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e | The training labels. It should have the same size as the samples. If you are training a classification model, the labels should be distinct integers for each class. If you are training a regression model, each label should be the value of the predicted variable. |\n\n\u003ca name=\"SVM+crossValidation\"\u003e\u003c/a\u003e\n\n### svM.crossValidation(samples, labels, kFold) ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\nPerforms k-fold cross-validation (KF-CV). KF-CV separates the data-set into kFold random equally sized partitions,\nand uses each as a validation set, with all other partitions used in the training set. Observations left over\nfrom if kFold does not divide the number of observations are left out of the cross-validation process. If\nkFold is one, this is equivalent to a leave-on-out cross-validation\n\n**Kind**: instance method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Returns**: \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e - The array of predicted labels produced by the cross validation. Has a size equal to\nthe number of samples provided as input.  \n**Throws**:\n\n- if SVM instance was instantiated from SVM.loadWASM() or SVM.loadASK().\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| samples | \u003ccode\u003eArray.\u0026lt;Array.\u0026lt;number\u0026gt;\u0026gt;\u003c/code\u003e | The training samples. |\n| labels | \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e | The training labels. |\n| kFold | \u003ccode\u003enumber\u003c/code\u003e | Number of datasets into which to split the training set. |\n\n\u003ca name=\"SVM+free\"\u003e\u003c/a\u003e\n\n### svM.free()\nFree the memory allocated for the model. Since this memory is stored in the memory model of emscripten, it is\nallocated within an ArrayBuffer and WILL NOT BE GARBARGE COLLECTED, you have to explicitly free it. So\nnot calling this will result in memory leaks. As of today in the browser, there is no way to hook the\ngarbage collection of the SVM object to free it automatically.\nFree the memory that was created by the compiled libsvm library to.\nstore the model. This model is reused every time the predict method is called.\n\n**Kind**: instance method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n\u003ca name=\"SVM+predictOne\"\u003e\u003c/a\u003e\n\n### svM.predictOne(sample) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nPredict the label of one sample.\n\n**Kind**: instance method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - - The predicted label.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| sample | \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e | The sample to predict. |\n\n\u003ca name=\"SVM+predict\"\u003e\u003c/a\u003e\n\n### svM.predict(samples) ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\nPredict the label of many samples.\n\n**Kind**: instance method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Returns**: \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e - - The predicted labels.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| samples | \u003ccode\u003eArray.\u0026lt;Array.\u0026lt;number\u0026gt;\u0026gt;\u003c/code\u003e | The samples to predict. |\n\n\u003ca name=\"SVM+predictProbability\"\u003e\u003c/a\u003e\n\n### svM.predictProbability(samples) ⇒ \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e\nPredict the label with probability estimate of many samples.\n\n**Kind**: instance method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Returns**: \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e - - An array of objects containing the prediction label and the probability estimates for each label  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| samples | \u003ccode\u003eArray.\u0026lt;Array.\u0026lt;number\u0026gt;\u0026gt;\u003c/code\u003e | The samples to predict. |\n\n\u003ca name=\"SVM+predictOneProbability\"\u003e\u003c/a\u003e\n\n### svM.predictOneProbability(sample) ⇒ \u003ccode\u003eobject\u003c/code\u003e\nPredict the label with probability estimate.\n\n**Kind**: instance method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Returns**: \u003ccode\u003eobject\u003c/code\u003e - - An object containing the prediction label and the probability estimates for each label  \n\n| Param | Type |\n| --- | --- |\n| sample | \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e | \n\n\u003ca name=\"SVM+predictOneInterval\"\u003e\u003c/a\u003e\n\n### svM.predictOneInterval(sample, confidence) ⇒ \u003ccode\u003eobject\u003c/code\u003e\nPredict a regression value with a confidence interval\n\n**Kind**: instance method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Returns**: \u003ccode\u003eobject\u003c/code\u003e - - An object containing the prediction value and the lower and upper bounds of the confidence interval  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| sample | \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e |  |\n| confidence | \u003ccode\u003enumber\u003c/code\u003e | A value between 0 and 1. For example, a value 0.95 will give you the 95% confidence interval of the predicted value. |\n\n\u003ca name=\"SVM+predictInterval\"\u003e\u003c/a\u003e\n\n### svM.predictInterval(samples, confidence) ⇒ \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e\nPredict regression values with confidence intervals\n\n**Kind**: instance method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Returns**: \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e - - An array of objects each containing the prediction label and the probability estimates for each label  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| samples | \u003ccode\u003eArray.\u0026lt;Array.\u0026lt;number\u0026gt;\u0026gt;\u003c/code\u003e | An array of samples. |\n| confidence | \u003ccode\u003enumber\u003c/code\u003e | A value between 0 and 1. For example, a value 0.95 will give you the 95% confidence interval of the predicted value. |\n\n\u003ca name=\"SVM+getLabels\"\u003e\u003c/a\u003e\n\n### svM.getLabels() ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\nGet the array of labels from the model. Useful when creating an SVM instance with SVM.load\n\n**Kind**: instance method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Returns**: \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e - - The list of labels.  \n\u003ca name=\"SVM+getSVIndices\"\u003e\u003c/a\u003e\n\n### svM.getSVIndices() ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\nGet the indices of the support vectors from the training set passed to the train method.\n\n**Kind**: instance method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Returns**: \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e - - The list of indices from the training samples.  \n\u003ca name=\"SVM+serializeModel\"\u003e\u003c/a\u003e\n\n### svM.serializeModel() ⇒ \u003ccode\u003estring\u003c/code\u003e\nUses libsvm's serialization method of the model.\n\n**Kind**: instance method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Returns**: \u003ccode\u003estring\u003c/code\u003e - The serialization string.  \n\u003ca name=\"SVM.SVM_TYPES\"\u003e\u003c/a\u003e\n\n### SVM.SVM_TYPES : \u003ccode\u003eObject\u003c/code\u003e\nSVM classification and regression types\n\n**Kind**: static property of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Properties**\n\n| Name | Description |\n| --- | --- |\n| C_SVC | The C support vector classifier type |\n| NU_SVC | The nu support vector classifier type |\n| ONE_CLASS | The one-class support vector classifier type |\n| EPSILON_SVR | The epsilon support vector regression type |\n| NU_SVR | The nu support vector regression type |\n\n\u003ca name=\"SVM.KERNEL_TYPES\"\u003e\u003c/a\u003e\n\n### SVM.KERNEL_TYPES : \u003ccode\u003eObject\u003c/code\u003e\nSVM kernel types\n\n**Kind**: static property of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Properties**\n\n| Name | Description |\n| --- | --- |\n| LINEAR | Linear kernel |\n| POLYNOMIAL | Polynomial kernel |\n| RBF | Radial basis function (gaussian) kernel |\n| SIGMOID | Sigmoid kernel |\n\n\u003ca name=\"SVM.loadASM\"\u003e\u003c/a\u003e\n\n### SVM.loadASM() ⇒ [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)\nCreate a SVM instance using ASM.\n\n**Kind**: a member method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Returns**: [\u003ccode\u003eSVM\u003c/code\u003e](#SVM) - - SVM instance that contains the model.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| serializedModel | \u003ccode\u003estring\u003c/code\u003e | The serialized model. |\n\n### SVM.loadWASM() ⇒ [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)\nCreate a SVM instance using WASM.\n\n**Kind**: a member method of [\u003ccode\u003eSVM\u003c/code\u003e](#SVM)  \n**Returns**: [\u003ccode\u003eSVM\u003c/code\u003e](#SVM) - - SVM instance that contains the model.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| serializedModel | \u003ccode\u003estring\u003c/code\u003e | The serialized model. |\n\n# LICENSE\nBSD-3-Clause\n\n[npm-image]: https://img.shields.io/npm/v/libsvm-ts.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/libsvm-ts\n[download-image]: https://img.shields.io/npm/dm/libsvm-ts.svg?style=flat-square\n[download-url]: https://www.npmjs.com/package/libsvm-ts\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachinelearnjs%2Flibsvm-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmachinelearnjs%2Flibsvm-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachinelearnjs%2Flibsvm-ts/lists"}