CachedEndpoint
Model Examples
Examples of using the Model Class are in the Examples section at the bottom of this page. AWS Model setup and deployment are quite complicated to do manually but the Workbench Model Class makes it a breeze!
CachedEndpoint: Caches the method results for Workbench Endpoints
CachedEndpoint
Bases: CachedArtifactMixin
, EndpointCore
CachedEndpoint: Caches the method results for Workbench Endpoints
Note: Cached method values may lag underlying Endpoint changes.
Common Usage
Source code in src/workbench/cached/cached_endpoint.py
__init__(endpoint_uuid)
details(**kwargs)
Retrieve the CachedEndpoint Details.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
A dictionary of details about the CachedEndpoint |
endpoint_metrics()
Retrieve the Endpoint Metrics
Returns:
Name | Type | Description |
---|---|---|
str |
Union[str, None]
|
The Endpoint Metrics |
health_check(**kwargs)
Retrieve the CachedEndpoint Health Check.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
A dictionary of health check details for the CachedEndpoint |
Source code in src/workbench/cached/cached_endpoint.py
summary(**kwargs)
Retrieve the CachedEndpoint Details.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
A dictionary of details about the CachedEndpoint |
workbench_meta()
Retrieve the Enumerated Model Type (REGRESSOR, CLASSIFER, etc).
Returns:
Name | Type | Description |
---|---|---|
str |
Union[str, None]
|
The Enumerated Model Type |
Source code in src/workbench/cached/cached_endpoint.py
Examples
All of the Workbench Examples are in the Workbench Repository under the examples/
directory. For a full code listing of any example please visit our Workbench Examples
Get Endpoint Details
from workbench.cached.cached_endpoint import CachedEndpoint
# Grab an Endpoint
end = CachedEndpoint("abalone-regression")
# Get the Details
end.details()
{'uuid': 'abalone-regression-end',
'health_tags': [],
'status': 'InService',
'instance': 'Serverless (2GB/5)',
'instance_count': '-',
'variant': 'AllTraffic',
'model_name': 'abalone-regression',
'model_type': 'regressor',
'model_metrics': RMSE R2 MAPE MedAE NumRows
1.64 2.246 0.502 16.393 1.209 834,
'confusion_matrix': None,
'predictions': class_number_of_rings prediction id
0 16 10.516158 7
1 9 9.031365 8
2 10 9.264600 17
3 7 8.578638 18
4 12 10.492446 27
.. ... ... ...
829 11 11.915862 4148
830 8 8.210898 4157
831 8 7.693689 4158
832 9 7.542521 4167
833 8 9.060015 4168