Skip to main content

Version, share, deploy, and monitor models.

Project description

vetiver

Lifecycle: experimental codecov

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:

You can use vetiver with:

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vetiver-0.2.4.tar.gz (290.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vetiver-0.2.4-py3-none-any.whl (113.2 kB view details)

Uploaded Python 3

File details

Details for the file vetiver-0.2.4.tar.gz.

File metadata

  • Download URL: vetiver-0.2.4.tar.gz
  • Upload date:
  • Size: 290.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.11

File hashes

Hashes for vetiver-0.2.4.tar.gz
Algorithm Hash digest
SHA256 08fa46d2d6f3b254a734b39d89f36b2549730ca5d1b41c0c4ee441c60de9f319
MD5 fee314e03ac142a22234f2ea590a387f
BLAKE2b-256 c7980ac5e3e66f9c1c6d9af11b97d8a66ed92c1c42813f0446e4574f1475a03c

See more details on using hashes here.

File details

Details for the file vetiver-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: vetiver-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 113.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.11

File hashes

Hashes for vetiver-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d6047b67e1bb4bb17160e700e672c43dfd9ef408836af3e47acbcff0f666f7c2
MD5 68e05d8857a8715afdcba4278f0799ba
BLAKE2b-256 c34a01549a8cac1e720b1cbe09196553ae022a917047d758a388e348c9efde68

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page