vetiver_create_description: Model constructor methods

Description Usage Arguments Details Examples

View source: R/prepare.R

Description

These are developer-facing functions, useful for supporting new model types. Each model supported by vetiver_model() uses up to four methods when the deployable object is created:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
## S3 method for class 'train'
vetiver_create_description(model)

## S3 method for class 'train'
vetiver_prepare_model(model)

## S3 method for class 'lm'
vetiver_create_description(model)

## S3 method for class 'lm'
vetiver_prepare_model(model)

## S3 method for class 'Learner'
vetiver_create_description(model)

## S3 method for class 'Learner'
vetiver_prepare_model(model)

vetiver_create_description(model)

## Default S3 method:
vetiver_create_description(model)

vetiver_prepare_model(model)

## Default S3 method:
vetiver_prepare_model(model)

## S3 method for class 'workflow'
vetiver_create_description(model)

## S3 method for class 'workflow'
vetiver_prepare_model(model)

## S3 method for class 'xgb.Booster'
vetiver_create_description(model)

Arguments

model

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

Details

These are four generics that use the class of model for dispatch.

Examples

1
2
3
cars_lm <- lm(mpg ~ ., data = mtcars)
vetiver_create_description(cars_lm)
vetiver_prepare_model(cars_lm)

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