{"id":13571795,"url":"https://github.com/ralfbiedert/ffsvm","last_synced_at":"2025-12-12T12:49:22.251Z","repository":{"id":57628833,"uuid":"113766927","full_name":"ralfbiedert/ffsvm","owner":"ralfbiedert","description":"FFSVM stands for \"Really Fast Support Vector Machine\"","archived":false,"fork":false,"pushed_at":"2024-12-14T16:04:25.000Z","size":885,"stargazers_count":75,"open_issues_count":2,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T15:19:13.821Z","etag":null,"topics":["libsvm","machine-learning","rust","svm-library"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/ralfbiedert.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-12-10T16:52:20.000Z","updated_at":"2025-03-03T12:00:33.000Z","dependencies_parsed_at":"2024-01-14T03:51:08.325Z","dependency_job_id":"0eed366d-af58-4a90-9cec-b64ff68953a6","html_url":"https://github.com/ralfbiedert/ffsvm","commit_stats":null,"previous_names":["ralfbiedert/ffsvm-rust"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralfbiedert%2Fffsvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralfbiedert%2Fffsvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralfbiedert%2Fffsvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralfbiedert%2Fffsvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ralfbiedert","download_url":"https://codeload.github.com/ralfbiedert/ffsvm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694877,"owners_count":20980733,"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":["libsvm","machine-learning","rust","svm-library"],"created_at":"2024-08-01T14:01:06.450Z","updated_at":"2025-12-12T12:49:22.215Z","avatar_url":"https://github.com/ralfbiedert.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"[![crates.io-badge]][crates.io-url]\n[![docs.rs-badge]][docs.rs-url]\n![license-badge]\n[![rust-version-badge]][rust-version-url]\n[![rust-build-badge]][rust-build-url]\n\n## In One Sentence\n\nYou trained an SVM using [libSVM](https://github.com/cjlin1/libsvm), now you want the highest possible performance during (real-time) classification, like games or VR.\n\n## Highlights\n\n* loads almost all [libSVM](https://github.com/cjlin1/libsvm) types (C-SVC, ν-SVC, ε-SVR,  ν-SVR) and kernels (linear, poly, RBF and sigmoid)\n* produces practically same classification results as libSVM\n* optimized for [SIMD](https://github.com/rust-lang/rfcs/pull/2366) and can be mixed seamlessly with [Rayon](https://github.com/rayon-rs/rayon)\n* written in 100% safe Rust\n* allocation-free during classification for dense SVMs\n* **2.5x - 14x faster than libSVM for dense SVMs**\n* extremely low classification times for small models (e.g., 128 SV, 16 dense attributes, linear ~ 500ns)\n* successfully used in **Unity and VR** projects (Windows \u0026 Android)\n\n## Usage\n\nTrain with [libSVM](https://github.com/cjlin1/libsvm) (e.g., using the tool `svm-train`), then classify with `ffsvm-rust`.\n\nFrom Rust:\n\n```rust\n// Replace `SAMPLE_MODEL` with a `\u0026str` to your model.\nlet svm = DenseSVM::try_from(SAMPLE_MODEL)?;\n\nlet mut fv = FeatureVector::from(\u0026svm);\nlet features = fv.features();\n\nfeatures[0] = 0.55838;\nfeatures[1] = -0.157895;\nfeatures[2] = 0.581292;\nfeatures[3] = -0.221184;\n\nsvm.predict_value(\u0026mut fv)?;\n\nassert_eq!(fv.label(), Label::Class(42));\n```\n\n## Status\n* **December 14, 2024**: **After 7+ years, finally ported to stable**.\u003csup\u003e🎉\u003c/sup\u003e\u003csup\u003e🎉\u003c/sup\u003e\u003csup\u003e🎉\u003c/sup\u003e\n* **March 10, 2023**: Reactivated for latest Rust nightly.\n* **June 7, 2019**: Gave up on 'no `unsafe`', but gained runtime SIMD selection.\n* **March 10, 2019**: As soon as we can move away from nightly we'll go beta.\n* **Aug 5, 2018**: Still in alpha, but finally on crates.io.\n* **May 27, 2018**: We're in alpha. Successfully used internally on Windows, Mac, Android and Linux\n  on various machines and devices. Once SIMD stabilizes and we can cross-compile to WASM\n  we'll move to beta.\n* **December 16, 2017**: We're in pre-alpha. It will probably not even work on your machine.\n\n\n## Performance\n\n![performance](https://raw.githubusercontent.com/ralfbiedert/ffsvm-rust/master/docs/performance_relative.v3.png)\n\nAll performance numbers reported for the `DenseSVM`. We also have support for `SparseSVM`s, which are slower\nfor \"mostly dense\" models, and faster for \"mostly sparse\" models (and generally on the performance level of libSVM).\n\n[See here for details.](https://github.com/ralfbiedert/ffsvm-rust/blob/master/docs/performance.md)\n\n\n#### Tips\n\n* Compile your project with `target-cpu=native` for a massive speed boost (e.g., check our `.cargo/config.toml` how\n  you can easily do that for your project). Note, due to how Rust works, this is only used for application\n  (or dynamic FFI libraries), not library crates wrapping us.\n* For an x-fold performance increase, create a number of `Problem` structures, and process them with [Rayon's](https://docs.rs/rayon/1.0.3/rayon/) `par_iter`.\n\n## FAQ\n\n[See here for details.](https://github.com/ralfbiedert/ffsvm-rust/blob/master/docs/FAQ.md)\n\n[crates.io-badge]: https://img.shields.io/crates/v/ffsvm.svg\n[crates.io-url]: https://crates.io/crates/ffsvm\n[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg\n[docs.rs-badge]: https://docs.rs/ffsvm/badge.svg\n[docs.rs-url]: https://docs.rs/ffsvm/\n[rust-version-badge]: https://img.shields.io/badge/rust-1.83%2B-blue.svg?maxAge=3600\n[rust-version-url]: https://github.com/ralfbiedert/ffsvm\n[rust-build-badge]: https://github.com/ralfbiedert/ffsvm/actions/workflows/rust.yml/badge.svg\n[rust-build-url]: https://github.com/ralfbiedert/ffsvm/actions/workflows/rust.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralfbiedert%2Fffsvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fralfbiedert%2Fffsvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralfbiedert%2Fffsvm/lists"}