{"id":31363777,"url":"https://github.com/brdav/fastrvm","last_synced_at":"2025-09-27T05:19:23.000Z","repository":{"id":316669749,"uuid":"1064372438","full_name":"brdav/fastrvm","owner":"brdav","description":"[fastrvm] Relevance Vector Machine in Python with a C++ Core","archived":false,"fork":false,"pushed_at":"2025-09-26T00:55:04.000Z","size":191,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-26T02:48:01.868Z","etag":null,"topics":["bayesian","classification","cpp","python","regression","relevance-vector-machine","sparse"],"latest_commit_sha":null,"homepage":"","language":"C++","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/brdav.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-26T00:08:23.000Z","updated_at":"2025-09-26T00:55:08.000Z","dependencies_parsed_at":"2025-09-26T02:48:04.269Z","dependency_job_id":"b5b91c8e-7266-4a7c-ae58-069aaa982159","html_url":"https://github.com/brdav/fastrvm","commit_stats":null,"previous_names":["brdav/fastrvm"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/brdav/fastrvm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brdav%2Ffastrvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brdav%2Ffastrvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brdav%2Ffastrvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brdav%2Ffastrvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brdav","download_url":"https://codeload.github.com/brdav/fastrvm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brdav%2Ffastrvm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277112175,"owners_count":25762983,"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-09-26T02:00:09.010Z","response_time":78,"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":["bayesian","classification","cpp","python","regression","relevance-vector-machine","sparse"],"created_at":"2025-09-27T05:19:22.231Z","updated_at":"2025-09-27T05:19:22.991Z","avatar_url":"https://github.com/brdav.png","language":"C++","readme":"# fastrvm\n\n[![Build Wheels](https://img.shields.io/github/actions/workflow/status/brdav/fastrvm/.github/workflows/build.yml?branch=main)](https://github.com/brdav/fastrvm/actions)\n[![PyPI version](https://img.shields.io/pypi/v/fastrvm.svg)](https://pypi.org/project/fastrvm)\n[![Python Versions](https://img.shields.io/pypi/pyversions/fastrvm.svg)](https://pypi.org/project/fastrvm)\n[![License](https://img.shields.io/github/license/brdav/fastrvm.svg)](LICENSE)\n\nA fast and clean implementation of the Relevance Vector Machine (RVM).\n\n![fastrvm teaser](https://raw.githubusercontent.com/brdav/fastrvm/main/docs/teaser.png)\n\n**fastrvm** implements Tipping's \"sparse Bayesian learning\" algorithm [2] in a high-performance C++ core and exposes scikit-learn-compatible Python wrappers for:\n\n- RVR — relevance vector regression\n- RVC — relevance vector classification\n\nKey benefits\n\n- Fast training and prediction due to the greedy learning algorithm and a tuned C++ linear-algebra core (Armadillo + Einsmallen for optimization).\n- Sparse models that automatically select a small set of relevance vectors.\n- scikit-learn-compatible Python wrappers: plug into pipelines, grid search, and common tooling.\n\n## Quick Start\n\nInstall the latest release from PyPI (wheels are provided for Ubuntu and macOS, Windows requires building from source):\n\n```bash\npip install fastrvm\n```\n\nRegression example (RVR):\n\n```python\nfrom fastrvm import RVR\nfrom sklearn.datasets import make_regression\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import r2_score\n\nX, y = make_regression(n_samples=500, n_features=50, noise=0.1, random_state=0)\nX_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)\n\nmodel = RVR(kernel='linear', fit_intercept=True, max_iter=2000)\nmodel.fit(X_train, y_train)\nprint('R2:', r2_score(y_test, model.predict(X_test)))\n```\n\nClassification example (RVC)\n\n```python\nfrom fastrvm import RVC\nfrom sklearn.datasets import make_classification\nfrom sklearn.pipeline import make_pipeline\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.model_selection import cross_val_score\n\nX, y = make_classification(n_samples=300, n_features=50, n_informative=10, random_state=0)\nclf = make_pipeline(StandardScaler(), RVC(kernel='rbf', gamma='scale', n_jobs=-1))\nscores = cross_val_score(clf, X, y, cv=5, scoring='accuracy')\nprint('5-fold accuracy:', scores.mean())\n```\n\nNotes on the Python API\n\n- Classes: `RVR` and `RVC` available from `fastrvm`.\n- Estimator API: implements scikit-learn conventions (`fit`, `predict`, etc.).\n- Kernel options: `rbf`, `linear`, `poly`, `precomputed` (scikit-learn-style names). Various kernel hyperparameters such as `gamma`, `degree`, and `coef0` are supported.\n- Multiclass classification: For efficiency reasons `RVC` uses a one-vs-rest classifier for multiclass classification.\n\nSee `docs/fastrvm.md` for a short reference doc.\n\n## Installation from Source\n\nFor development install from source:\n\n```bash\ngit clone https://github.com/brdav/fastrvm.git\ncd fastrvm\ngit submodule update --init --recursive\npython -m pip install -e '.[dev]'\n```\n\nMinimum build dependencies\n\n- CMake \u003e= 3.18\n- Python \u003e= 3.9 (development headers)\n- C++17-capable compiler (clang, gcc, or MSVC)\n- BLAS/LAPACK implementation (OpenBLAS, MKL, or Accelerate)\n\nNote: Builds on Windows are untested in CI. You can attempt a Windows build but expect manual steps.\n\nThe C++ core (sparse Bayesian learning algorithm) can also be built independently:\n\n```bash\ncmake -S src/cpp -B build/cpp -DCMAKE_BUILD_TYPE=Release\ncmake --build build/cpp --target sparsebayes -j\n```\n\n## Citation\n\nKey references:\n\n1. Tipping, M. E. (2001). Sparse Bayesian Learning and the Relevance Vector Machine. Journal of Machine Learning Research, 1, 211–244.\n\n2. Tipping, M. E. \u0026 Faul, A. C. (2003). Fast Marginal Likelihood Maximisation for Sparse Bayesian Models. Proceedings of the 4th International Workshop on Artificial Intelligence and Statistics (AISTATS / PMLR), pages 276–283, 2003.\n\nThis implementation follows the ideas and practical choices from the SparseBayes (v2.0) MATLAB package by Michael Tipping — see the [SparseBayes v2.0 download page](https://www.miketipping.com/downloads.htm). Please cite [1] for the core algorithm and [2] for the marginal-likelihood acceleration where applicable.\n\n## License\n\nMIT — see `LICENSE` for details.\n\n---\nQuestions, feature requests, or issues? Open an issue on GitHub.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrdav%2Ffastrvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrdav%2Ffastrvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrdav%2Ffastrvm/lists"}