- class vetiver.VetiverModel(model, model_name: str, prototype_data=None, versioned=None, description: Optional[str] = None, metadata: Optional[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) – Sample of data model should expect when it is being served
versioned – Should the model be versioned when created?
description (str) – A detailed description of the model. If omitted, a brief description will be generated.
metadata (dict) – Other details to be saved and accessed for serving
**kwargs (dict) – Deprecated parameters.
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.
>>> from vetiver import mock, VetiverModel >>> X, y = mock.get_mock_data() >>> model = mock.get_mock_model().fit(X, y) >>> v = VetiverModel(model = model, model_name = "my_model", prototype_data = X) >>> v.description 'A scikit-learn DummyRegressor model'
- __init__(model, model_name: str, prototype_data=None, versioned=None, description: Optional[str] = None, metadata: Optional[dict] = None, **kwargs)#
__init__(model, model_name[, ...])
from_pin(board, name[, version])