Skip to content

Commit

Permalink
Merge pull request #28 from posit-conf-2023/fix-metadata-exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelizimm authored Sep 15, 2023
2 parents 9968371 + fe9f3b8 commit c002719
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
9 changes: 4 additions & 5 deletions class-work/03-deploy-python.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,19 @@ board = ___
vetiver_write_pin(___, ___)
```

Get your own metrics metadata:
Get your metrics metadata:

```{python}
metadata = board.pin_meta(___)
extracted_metrics = pd.DataFrame(metadata.user.get("user"))
extracted_metrics
```

Get **your neighbor's** metrics metadata:
If you have time, get **your neighbor's** metrics metadata by calling the `/metadata` endpoint of their model:

```{python}
metadata = board.pin_meta(___)
extracted_metrics = pd.DataFrame(metadata.user.get("user"))
extracted_metrics
url = ___
print(requests.get(url).content)
```

## Add a new endpoint to your API ✨
Expand Down
9 changes: 5 additions & 4 deletions class-work/03-deploy-rstats.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ board <- ___
board |> ___
```

Get your own metrics metadata:
Get your metrics metadata:

```{r}
extracted_metrics <-
Expand All @@ -79,11 +79,12 @@ extracted_metrics <-
extracted_metrics
```

Get **your neighbor's** metrics metadata:
If you have time, get **your neighbor's** metrics metadata by calling the `/metadata` endpoint of their model:

```{r}
board |>
pin_meta(___) |>
url <- ___
r <- httr::content(httr::GET(url), as = "text", encoding = "UTF-8")
jsonlite::fromJSON(___) |>
pluck("user", "metrics") |>
as_tibble()
```
Expand Down
2 changes: 1 addition & 1 deletion slides/03-deploy.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ extracted_metrics

Obtain the metrics metadata for your versioned model.

Obtain the metrics metadata for _your neighbor's_ model.
Optional: Obtain the metrics metadata for _your neighbor's_ model by calling the `/metadata` endpoint for their API.

What else might you want to store as model metadata?

Expand Down

0 comments on commit c002719

Please sign in to comment.