from vetiver import mock, VetiverModel
= mock.get_mock_data()
X, y = mock.get_mock_model().fit(X, y)
model = VetiverModel(model = model, model_name = "my_model", prototype_data = X)
v v.description
'A scikit-learn DummyRegressor model'
VetiverModel(
self,
model,
model_name: str,
prototype_data,
versioned,
description: str = None,
metadata: dict = None,
**kwargs,
)
Create VetiverModel class for serving.
model :
A trained model, such as an sklearn or torch model
model_name : string
Model name or ID
prototype_data : (pd.DataFrame, np.array) = None
Sample of data model should expect when it is being served
versioned : = None
Should the model be versioned when created?
description : str = None
A detailed description of the model. If omitted, a brief description will be generated.
metadata : dict = None
Other details to be saved and accessed for serving
kwargs : = {}
Deprecated parameters.
prototype : vetiver.Prototype
Data prototype
handler_predict : Callable
Method to make predictions from a trained model
VetiverModel can also take an initialized custom VetiverHandler as a model, for advanced use cases or non-supported model types. Parameter ptype_data
was changed to prototype_data
. Handling of ptype_data
will be removed in a future version.
Name | Description |
---|---|
from_pin | Create VetiverModel from pinned model. |
Create VetiverModel from pinned model.
board :
pins
board where model is located
name : str
Model name inside pins board
version : str = None
What model version should be loaded