vetiver_create_meta: Metadata constructors for 'vetiver_model()' object

Description Usage Arguments Value Examples

View source: R/meta.R

Description

These are developer-facing functions, useful for supporting new model types. The metadata stored in a vetiver_model() object has four elements:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## S3 method for class 'train'
vetiver_create_meta(model, metadata)

vetiver_meta(user = list(), version = NULL, url = NULL, required_pkgs = NULL)

vetiver_create_meta(model, metadata)

## Default S3 method:
vetiver_create_meta(model, metadata)

## S3 method for class 'Learner'
vetiver_create_meta(model, metadata)

## S3 method for class 'workflow'
vetiver_create_meta(model, metadata)

## S3 method for class 'xgb.Booster'
vetiver_create_meta(model, metadata)

Arguments

model

A trained model, such as an lm() model or a tidymodels workflows::workflow().

metadata

A list containing additional metadata to store with the pin. When retrieving the pin, this will be stored in the user key, to avoid potential clashes with the metadata that pins itself uses.

user

Metadata supplied by the user

version

Version of the pin

url

URL for the pin, if any

required_pkgs

Character string of R packages required for prediction

Value

The vetiver_meta() constructor returns a list. The vetiver_create_meta function returns a vetiver_meta() list.

Examples

1
2
3
4
vetiver_meta()

cars_lm <- lm(mpg ~ ., data = mtcars)
vetiver_create_meta(cars_lm, list())

tidymodels/vetiver documentation built on Jan. 14, 2022, 7:32 p.m.