vetiver_create_description.train | R Documentation |
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:
The vetiver_create_description()
function generates a helpful description
of the model based on its characteristics. This method is required.
The vetiver_create_meta()
function creates the correct vetiver_meta()
for the model. This is especially helpful for specifying which packages are
needed for prediction. A model can use the default method here, which is
to have no special metadata.
The vetiver_ptype()
function finds an input data prototype from the
training data (a zero-row slice) to use for checking at prediction time.
This method is required.
The vetiver_prepare_model()
function executes last. Use this function
for tasks like checking if the model is trained and reducing the size of the
model via butcher::butcher()
. A model can use the default method here,
which is to return the model without changes.
## S3 method for class 'train'
vetiver_create_description(model)
## S3 method for class 'train'
vetiver_prepare_model(model)
## S3 method for class 'gam'
vetiver_create_description(model)
## S3 method for class 'gam'
vetiver_prepare_model(model)
## S3 method for class 'glm'
vetiver_create_description(model)
## S3 method for class 'glm'
vetiver_prepare_model(model)
## S3 method for class 'keras.engine.training.Model'
vetiver_create_description(model)
## S3 method for class 'keras.engine.training.Model'
vetiver_prepare_model(model)
## S3 method for class 'kproto'
vetiver_create_description(model)
## S3 method for class 'kproto'
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 'luz_module_fitted'
vetiver_create_description(model)
## S3 method for class 'luz_module_fitted'
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 'ranger'
vetiver_create_description(model)
## S3 method for class 'ranger'
vetiver_prepare_model(model)
## S3 method for class 'recipe'
vetiver_create_description(model)
## S3 method for class 'recipe'
vetiver_prepare_model(model)
## S3 method for class 'model_stack'
vetiver_create_description(model)
## S3 method for class 'model_stack'
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)
## S3 method for class 'xgb.Booster'
vetiver_prepare_model(model)
model |
A trained model, such as an |
These are four generics that use the class of model
for dispatch.
cars_lm <- lm(mpg ~ ., data = mtcars)
vetiver_create_description(cars_lm)
vetiver_prepare_model(cars_lm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.