Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wardbrian/scikit-stan
A sklearn style interface to Stan regression models
https://github.com/wardbrian/scikit-stan
python scikit-learn sklearn-compatible stan
Last synced: 3 months ago
JSON representation
A sklearn style interface to Stan regression models
- Host: GitHub
- URL: https://github.com/wardbrian/scikit-stan
- Owner: WardBrian
- License: bsd-3-clause
- Created: 2022-06-06T15:47:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-14T01:26:51.000Z (3 months ago)
- Last Synced: 2024-10-14T19:21:02.032Z (3 months ago)
- Topics: python, scikit-learn, sklearn-compatible, stan
- Language: Python
- Homepage: https://scikit-stan.readthedocs.io/
- Size: 9.48 MB
- Stars: 25
- Watchers: 3
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scikit-stan
Scikit-Stan is a package of [Stan](https://mc-stan.org/) models wrapped in a
[Scikit-Learn](https://scikit-learn.org/stable/) style interface.This package is currently under active development and should be treated as beta software.
Documentation is available at https://brianward.dev/scikit-stan/ or on [ReadTheDocs](https://scikit-stan.readthedocs.io/)
(older versions and PDFs available).## Installation
Pre-compiled wheels for the package are available for MacOS, Windows, and Linux systems via `pip install scikit_stan`.
Source installation requires a working installation of [CmdStan](https://mc-stan.org/docs/cmdstan-guide/index.html).
## Basic usage
```python
from scikit_stan import GLMm = GLM(family='gamma') # Gamma family distribution with canonical inverse link
m.fit(X, y) # runs HMC-NUTS
predictions = m.predict(X) # generates new predictions from fitted model
score = m.score(X, y) # computes the R2 score of the fitted model on the data X and observations y
```## Attribution
This package is licensed under the BSD 3-clause license.
It is inspired by existing packages in the Stan ecosystem like
[rstanarm](https://github.com/stan-dev/rstanarm).This package was initially developed at the Simons Foundation by Alexey Izmailov during
a summer 2022 internship under the mentorship of Brian Ward.