define a pointer to a machine learning model.
Attributes
| Name | Type | Description |
|---|---|---|
| key | str | model storage key. |
| twin_hardware_id | str | hardware ID of the twin associated with this model. |
| property_value | str | property value when using 'by_property' training. |
| alias | str | model alias pointer (version identifier). |
| model_type | str | mlflow model flavour (e.g. sklearn, pyfunc, pytorch). |
| file_format | str | model file format ('pkl' for pickle or 'pt' for PyTorch). |
| source | str | model storage source (e.g. 'wizata'). |
| property_name | str | property name when using 'by_property' training. |
| trained_model | the trained model object (loaded from repository). | |
| scaler | scaler object associated with the model. | |
| files | list | list of ModelFile of model content. |
| updated_date | int | timestamp of last update. |
| metadata | dict | additional model metadata. |
Methods
add_file()
add a path to list of known path.
detect depending on file type further actions.
| Name | Type | Default | Description |
|---|---|---|---|
| file | ModelFile | ModelFile | |
| return: None |
bind_api()
internal method to bind the api to the dto.
| Name | Type | Default | Description |
|---|---|---|---|
| api | ApiDtoInterface | api client | |
| return: None |
from_json()
load this entity from a dict
| Name | Type | Default | Description |
|---|---|---|---|
| obj |
identifier()
returns the complete string identifier for this model.
| Name | Type | Default | Description |
|---|---|---|---|
| include_alias | bool | False | include the alias pointer or leave it to target the default version. |
| return: complete identifier of a model. |
load()
load the trained model from the repository.
to_json()
convert this entity in a dict that can be json serializable
return: dict