Skip to content

Commit 07741fe

Browse files
authored
Merge pull request #48 from rstudio/refine-readme
Refine README + docs
2 parents c976917 + 8955678 commit 07741fe

3 files changed

Lines changed: 51 additions & 27 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,7 @@ dmypy.json
137137
.pyre/
138138

139139
NOTES.md
140+
141+
## RStudio
142+
*.Rproj
143+
.Rproj.user

README.md

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# vetiver <img src='docs/figures/logo.png' align="right" height="139" />
1+
# vetiver <a href='https://rstudio.github.io/vetiver-python/'><img src='docs/figures/logo.png' align="right" height="139" /></a>
22

33
<!-- badges: start -->
44

@@ -9,42 +9,63 @@ experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](h
99

1010
_Vetiver, the oil of tranquility, is used as a stabilizing ingredient in perfumery to preserve more volatile fragrances._
1111

12-
Python parallel to [R vetiver](https://github.com/tidymodels/vetiver) package.
12+
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/>
1313

14-
## Usage
14+
You can use vetiver with:
1515

16-
`vetiver` is used to deploy a trained model to predict from a remote endpoint.
16+
- [scikit-learn](https://scikit-learn.org/)
17+
- [PyTorch](https://pytorch.org/)
1718

18-
Key features include:
19+
## Installation
1920

20-
- **Simple:** designed to fit into a data scientist's natural workflow
21-
- **Robust:** ability to check input data types to minimize type failures in a model
22-
- **Advanced support:** easily deploy multiple endpoints to handle pre- and post- processing
23-
- Based on [FastAPI](https://github.com/tiangolo/fastapi), using [OpenAPI](https://github.com/OAI/OpenAPI-Specification)
21+
You can install the released version of vetiver from [PyPI](https://pypi.org/project/vetiver/):
2422

25-
## Get Started
23+
```python
24+
pip install vetiver
25+
```
2626

27-
`pip install vetiver`
27+
And the development version from [GitHub](https://github.com/rstudio/vetiver-python) with:
2828

29-
To begin, initialize a `VetiverModel` with a trained model and an example of data (usually training data) to built a data prototype.
29+
```python
30+
python -m pip install git+https://github.com/rstudio/vetiver-python
31+
```
32+
33+
## Example
34+
35+
A `VetiverModel()` object collects the information needed to store, version, and deploy a trained model.
3036

3137
```python
32-
my_model = VetiverModel(model = linear_reg, ptype_data = train_data)
38+
from vetiver import mock, VetiverModel
39+
40+
X, y = mock.get_mock_data()
41+
model = mock.get_mock_model().fit(X, y)
42+
43+
v = VetiverModel(model, save_ptype=True, ptype_data=X)
3344
```
3445

35-
Next, you can build a model-aware API and run it locally.
46+
You can **version** and **share** your `VetiverModel()` by choosing a [pins](https://rstudio.github.io/pins-python/) "board" for it, including a local folder, RStudio Connect, Amazon S3, and more.
3647

3748
```python
38-
my_app = VetiverAPI(my_model)
39-
my_app.run()
49+
from pins import board_temp
50+
from vetiver import vetiver_pin_write
51+
52+
model_board = board_temp(versioned = True, allow_pickle_read = True)
53+
vetiver_pin_write(model_board, v)
4054
```
4155

42-
To view more, see [this repo of examples](https://github.com/isabelizimm/vetiverpydemo).
56+
You can **deploy** your pinned `VetiverModel()` using `VetiverAPI()`, an extension of [FastAPI](https://fastapi.tiangolo.com/).
4357

44-
## License
58+
```python
59+
from vetiver import VetiverAPI
60+
app = VetiverAPI(v, check_ptype = True)
61+
```
62+
63+
To start a server using this object, use `app.run(port = 8080)` or your port of choice.
4564

4665
## Contributing
4766

48-
This project is released with a [Contributor Code of
49-
Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html).
50-
By contributing to this project, you agree to abide by its terms.
67+
This project is released with a [Contributor Code of Conduct](https://www.contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
68+
69+
- For questions and discussions about deploying models, statistical modeling, and machine learning, please [post on RStudio Community](https://community.rstudio.com/new-topic?category_id=15&tags=vetiver,question).
70+
71+
- If you think you have encountered a bug, please [submit an issue](https://github.com/rstudio/vetiver-python/issues).

docs/source/index.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
vetiver
22
===================================
3-
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.
3+
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.
44
You can use vetiver with:
55

66
- `scikit-learn <https://scikit-learn.org/stable/>`_
@@ -12,16 +12,15 @@ You can install the released version of vetiver from `PyPI <https://pypi.org/pro
1212
1313
pip install vetiver
1414
15-
And the development version from `GitHub <https://github.com/tidymodels/vetiver-python>`_ with:
15+
And the development version from `GitHub <https://github.com/rstudio/vetiver-python>`_ with:
1616

1717
.. code-block:: bash
1818
19-
python -m pip install git+https://github.com/tidymodels/vetiver-python
19+
python -m pip install git+https://github.com/rstudio/vetiver-python
2020
2121
22-
This website documents the public API of Vetiver (for Python). See the `main Vetiver website <https://juliasilge.github.io/vetiver.dev/>`_ for
23-
a more holistic introduction to the API. The left-hand sidebar lists the full public
24-
API, and the sections below (linked to the right-hand sidebar) break it into similar groups, based on task.
22+
This website documents the public API of Vetiver (for Python). See `vetiver.rstudio.com <https://vetiver.rstudio.com>`_ for
23+
more on how to get started.
2524

2625
.. toctree::
2726
:maxdepth: 2

0 commit comments

Comments
 (0)