Model Registry#
You can obtain a ModelRegistry using Project.get_model_registry.
ModelRegistry #
shared_registry_project_name property #
shared_registry_project_name
Name of the project the shared model registry originates from.
get_best_model #
Get the best performing model entity from the model registry.
Getting the best performing model from the Model Registry means specifying in addition to the name, also a metric name corresponding to one of the keys in the training_metrics dict of the model and a direction. For example, to get the model version with the highest accuracy, specify metric='accuracy' and direction='max'.
| PARAMETER | DESCRIPTION |
|---|---|
name | Name of the model to get. TYPE: |
metric | Name of the key in the training metrics field to compare. TYPE: |
direction | 'max' to get the model entity with the highest value of the set metric, or 'min' for the lowest. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
model.Model | None |
|
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If unable to retrieve model from the model registry. |
get_model #
Get a model entity from the model registry.
Getting a model from the Model Registry means getting its metadata handle so you can subsequently download the model directory.
| PARAMETER | DESCRIPTION |
|---|---|
name | Name of the model to get. TYPE: |
version | Version of the model to retrieve, defaults to TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
model.Model | None |
|
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If unable to retrieve model from the model registry. |
get_models #
Get all model entities from the model registry for a specified name.
Getting all models from the Model Registry for a given name returns a list of model entities, one for each version registered under the specified model name.
| PARAMETER | DESCRIPTION |
|---|---|
name | Name of the model to get. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
list[model.Model] |
|
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If unable to retrieve model versions from the model registry. |