vetiver 
Vetiver, the oil of tranquility, is used as a stabilizing ingredient in perfumery to preserve more volatile fragrances.
The goal of vetiver is to provide fluent tooling to version, share, deploy, and monitor a trained model. Functions handle both recording and checking the model's input data prototype, and predicting from a remote API endpoint. The vetiver package is extensible, with generics that can support many kinds of models, and available for both Python and R. To learn more about vetiver, see:
- the documentation at https://vetiver.rstudio.com/
- the R package at https://rstudio.github.io/vetiver-r/
You can use vetiver with:
- scikit-learn
- torch
- statsmodels
- xgboost
- spacy
- or utilize custom handlers to support your own models!
Installation
You can install the released version of vetiver from PyPI:
python -m pip install vetiver
And the development version from GitHub with:
python -m pip install git+https://github.com/rstudio/vetiver-python
Example
A VetiverModel() object collects the information needed to store, version, and deploy a trained model.
from vetiver import mock, VetiverModel
X, y = mock.get_mock_data()
model = mock.get_mock_model().fit(X, y)
v = VetiverModel(model, model_name='mock_model', prototype_data=X)
You can version and share your VetiverModel() by choosing a pins "board" for it, including a local folder, Connect, Amazon S3, and more.
from pins import board_temp
from vetiver import vetiver_pin_write
model_board = board_temp(versioned = True, allow_pickle_read = True)
vetiver_pin_write(model_board, v)
You can deploy your pinned VetiverModel() using VetiverAPI(), an extension of FastAPI.
from vetiver import VetiverAPI
app = VetiverAPI(v, check_prototype = True)
To start a server using this object, use app.run(port = 8080) or your port of choice.
Contributing
This project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
-
For questions and discussions about deploying models, statistical modeling, and machine learning, please post on Posit Community.
-
If you think you have encountered a bug, please submit an issue.
Metadata
Release files for vetiver 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vetiver-0.2.6.tar.gz | 292.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vetiver-0.2.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 406.3 kB
Release files / vetiver-0.2.6.tar.gz
| Download URL | vetiver-0.2.6.tar.gz |
|---|---|
| Size | 292.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10c04747114e61168fede498fdaf441e78794554433ef66d61ffcda478e1d955
|
|
BLAKE2b-256 checksum How to use checksums |
d3a2a4e14ace7ff6eb30f59ef043448918cf117c26928dae8116213e12a86883
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Release files / vetiver-0.2.6-py3-none-any.whl
| Download URL | vetiver-0.2.6-py3-none-any.whl |
|---|---|
| Size | 113.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c6713ee60b0c523b805b6cfb4612c97ec38cc9c88f618bf40a00539f622fa04
|
|
BLAKE2b-256 checksum How to use checksums |
330875fff3507fc365444fe16e88da2470601dfd83272a12058cff45e4b931b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|