library(tidyverse) library(vetiver) library(pins) library(yardstick) knitr::opts_chunk$set(echo = FALSE) v <- vetiver_pin_read(params$board, params$name, version = params$version) v_meta <- pin_meta(params$board, params$name) theme_set(theme_light())
A model card provides brief, transparent, responsible reporting for a trained machine learning model.
r cli::pluralize("{v$description} using {ncol(v$prototype)} feature{?s}")
r v$metadata$version
of this model was published at r v_meta$created
The training dataset for this model has the "prototype" or signature:
r
glimpse(v$prototype)
The evaluation dataset used in this model card is ...
## EVALUATION DATA: data(Sacramento, package = "modeldata") ## consider using a package like skimr or DataExplorer for automated ## presentation of evaluation data characteristics
## compute predictions for your evaluation data ## load packages needed for prediction: library(parsnip) library(workflows) preds <- augment(v, Sacramento)
preds %>% metrics(price, .pred)
preds %>% group_by(type) %>% metrics(price, .pred)
preds %>% ggplot(aes(price, .pred, color = type)) + geom_abline(slope = 1, lty = 2, color = "gray60", size = 1.2) + geom_point(alpha = 0.5, show.legend = FALSE) + facet_wrap(vars(type))
preds %>% mutate(.resid = price - .pred) %>% ggplot(aes(longitude, latitude, color = .resid)) + geom_point(alpha = 0.8) + scale_color_gradient2() + coord_fixed()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.