Skip to content

Commit 2d525e2

Browse files
committed
Refine README
1 parent 5e0fd7f commit 2d525e2

1 file changed

Lines changed: 42 additions & 21 deletions

File tree

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, VetiverAPI
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()` via [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).

0 commit comments

Comments
 (0)