Skip to content

Commit bb4fe60

Browse files
committed
updates from review
1 parent f0517a2 commit bb4fe60

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

vetiver/model_card.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ def model_card(path="."):
99
----------
1010
path : str
1111
Path to save model card
12+
13+
Notes
14+
-----
15+
This model card is generated as a Quarto document. For more info on
16+
Quarto, visit https://quarto.org/
1217
"""
1318
src_path = _files("vetiver") / "templates/model_card.qmd"
1419

vetiver/templates/model_card.qmd

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ from sklearn import metrics
3131
import vetiver
3232
3333
v = vetiver.VetiverModel.from_pin(board, "v")
34+
# your pin will most likely have a version already, but we will make one here
35+
v.metadata.put()
3436
v_meta = board.pin_meta("v")
3537
```
3638

@@ -42,20 +44,24 @@ A [model card](https://doi.org/10.1145/3287560.3287596) provides brief, transpar
4244
- Developed by PERSON AND/OR TEAM
4345
```{python}
4446
#| echo: false
47+
model_desc = v.description
48+
num_features = len(v.ptype.construct().dict())
49+
4550
display(Markdown(f"""
46-
- A {v.description} using {len(v.ptype.construct().dict())} features.
51+
- A {model_desc} using {num_features} feature{'s'[:num_features^1]}.
4752
"""))
4853
```
4954
- More details about how model was developed and what it is predicting
5055
- More details on feature engineering and/or data preprocessing for model
5156
```{python}
5257
#| echo: false
53-
display(Markdown(f"""
54-
- Version {v.metadata.get("version")} was created at {
55-
datetime.datetime.strptime(
56-
v_meta.created, '%Y%m%dT%H%M%SZ')
58+
version = v.metadata.get("version")
59+
time_created = datetime.datetime
60+
.strptime(v_meta.created, '%Y%m%dT%H%M%SZ')
5761
.strftime('%Y-%m-%d %H:%M:%S')
58-
}
62+
63+
display(Markdown(f"""
64+
- Version {version} was created at {time_created}
5965
"""))
6066
```
6167

0 commit comments

Comments
 (0)