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 SageWorks Model Class makes it a breeze!
CachedEndpoint: Caches the method results for SageWorks Endpoints
CachedEndpoint
Bases: CachedArtifactMixin
, EndpointCore
CachedEndpoint: Caches the method results for SageWorks Endpoints
Note: Cached method values may lag underlying Endpoint changes.
Common Usage
Source code in src/sageworks/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/sageworks/cached/cached_endpoint.py
sageworks_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/sageworks/cached/cached_endpoint.py
summary(**kwargs)
Retrieve the CachedEndpoint Details.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
A dictionary of details about the CachedEndpoint |
Examples
All of the SageWorks Examples are in the Sageworks Repository under the examples/
directory. For a full code listing of any example please visit our SageWorks Examples
Get Endpoint Details
from sageworks.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