Get Single Drift Result API
A drift can consist of multiple drift evaluation results. Use this API to get details of a single drift evaluation result within a specific monitor.
HTTP method and URI path
GET /api/<monitor_id>/drift/results/<drift_evaluation_id>
-
monitor_id indicates the monitor ID.
-
drift_evaluation_id indicates the drift evaluation ID.
Standard headers
Use the following standard HTTP headers with this request:
- Content-Type: application/json
- Authorization: <Bearer token>
Required authorization
The user ID associated with the token which is specified in the request header must be granted with one of the following roles:
- sysadm
- mladm
- api user (only if the user created the monitor)
Expected response
On completion, the service returns an HTTP response, which includes a status code that indicates whether your request is completed. Status code 200 indicates that the request is complete.
The response example of a successful request is as follows:
{
"deployment_id": "c0f2022d-c98e-4659-ac17-b1cd79744062",
"drift_id": "26baadf7-36f9-4c3a-b4ca-735ab1ae535d",
"drift_insights": {
"features_insights": {
"bool1": {
"categories": [
0.0,
1.0
],
"distribution": {
"runtime_count": [
8,
8
],
"training_count": [
9,
7
]
}
},
"uint16": {
"distribution": {
"runtime": {
"max": 10.0,
"min": 2.0,
"x": {"max": 10.0, "min": 1.0},
"y": []
},
"training": {
"max": 9.0,
"min": 1.0,
"x": {"max": 10.0, "min": 1.0},
"y": []
}
},
"significance": {
"decreased_intervals": [
{
"absolute_percentage_change": -0.875,
"lower_bound": 0.0,
"runtime_count": 0,
"runtime_percentage": 0.0,
"training_count": 14,
"training_percentage": 0.875,
"upper_bound": 1.5
}
],
"increased_intervals": [
{
"absolute_percentage_change": 0.875,
"lower_bound": 1.5,
"runtime_count": 15,
"runtime_percentage": 0.9375,
"training_count": 1,
"training_percentage": 0.0625,
"upper_bound": 4.0
}
]
}
}
},
outputs_insights": {
"prediction": {
"distribution": {
"runtime": {
"max": 1.0,
"min": 0.0,
"x": {"max": 1.0, "min": 0.0},
"y": []
},
"training": {
"max": 1.0,
"min": 0.0,
"x": {"max": 1.0, "min": 0.0},
"y": []
}
},
"drift_scores": {
"features_drift": {
"bool1": {
"js": [0.044, false],
"tvd": [0.062, true]
},
"uint16": {
"oc": [0.198, true],
"tvd": [0.90625, true]
}
},
"outputs_drift": {
"prediction": {
"oc": [0.0, false]
}
}
},
"drift_source": "scheduler",
"entity": {
"counts": {
"runtime": 500,
"training": 500
},
"issues": {
"feature": 3,
"output": 0
}
},
"error": "",
"issues": 3,
"modified_at": "2024-04-22 08:04:26",
"modified_user": "user01",
"status": "finished",
"subscription_id": "e9f29436-6b00-49e7-b822-286b07a2c56a",
"subscription_version": 1
}
drift_info": {
"enabled": true,
"error": "",
"feature_importances": {
"feature_1": 0.18291666666666667,
"feature_2": 0.19166666666666665,
"feature_3": 0.0012499999999999976,
"feature_4": 0.022916666666666644
},
"important_features": [
"feature_1",
"feature_2",
"feature_3",
"feature_4"
],
"latest_evaluation": {
"issues": {
"feature": 0,
"output": 0
},
"status": ""
},
"max_samples": 1000000,
"min_samples": 10,
"scheduler": {
"last_evaluation": "",
"next_evaluation": "",
"repeat_interval": 1,
"repeat_unit": "day"
},
"status": "finished",
"thresholds": {
"feature": 0.42,
"model": -1,
"output": 0.3
}
}
"prediction_insights": {
"runtime": {
"class_1": 0.25333333333333335,
"class_2": 0.7466666666666667
},
"training": {
"class_1": 0.3333333333333333,
"class_2": 0.3333333333333333,
"class_3": 0.3333333333333333
}
}
}
The request content contains a JSON object. See the following table for description of the fields.
| Parameter | Subfield level 1 | Subfield level 2 | Description |
|---|---|---|---|
|
deployment_id |
NA |
NA |
Indicates the unique deployment ID. |
|
drift_id |
NA |
NA |
Indicates the unique ID of the drift evaluation result. |
|
drift_source |
NA |
NA |
Indicates the method of initiating the drift evaluation.
|
|
drift_scores |
feature_drift:
|
js: [ js_score, true/false] |
Indicates the drift scores of every feature based on one of the following algorithms. It also indicates whether the drift has occurred.
|
|
tvd: [tvd_score, true/false] |
|||
|
oc: [oc_score, true/false] |
|||
|
output_drift
|
js: [ js_score, true/false] |
Indicates the drift scores of the predictions and probabilities on basis of one of the following algorithms. It also indicates whether the drift has occurred.
|
|
|
tvd: [tvd_score, true/false] |
|||
|
oc: [oc_score, true/false] |
|||
|
drift_insights |
output_insights |
output1
output2: ... ... |
Indicates the following distribution and significance details for each output insight:
|
|
feature_insights |
Categorical_feature1: categories:[] distribution:
|
Indicates the feature insight based on the Categorical_feature.
categories - stores all the values of the feature. distribution - stores the number of records of each feature’s value of the training data and runtime data.
|
|
|
Continuous_feature: distribution:
|
Indicates the feature insight based on the Continuous_feature.
|
||
|
significance: decreased_intervals:
increased_intervals:
|
|
||
|
entity |
counts |
runtime |
Indicates the number of runtime data records. |
|
training |
Indicates the number of training data records. |
||
|
issues |
feature |
Indicates the total number of features that have the drift alert. |
|
|
output |
Indicates the total number of outputs that have the drift alert. |
||
|
error |
NA |
NA |
Indicates the error message of the monitor. |
|
issues |
NA |
NA |
Indicates the total number of features and outputs that are part of the drift evaluation. |
|
modified_at |
NA |
NA |
Indicates the time of the last modification of the monitor. |
|
modified_user |
NA |
NA |
Indicates the name of the user who last modified the monitor. |
|
status |
NA |
NA |
Indicates the status of the monitor. |
|
subscription_id |
NA |
NA |
Indicates the unique ID of the monitor. |
|
subscription_version |
NA |
NA |
Indicates the version of the monitor. |
|
drift_info |
enabled |
NA |
Indicates whether drift info is enabled. |
|
error |
NA |
Indicates error message for evaluation. |
|
|
feature_importances |
feature_1 ... ... |
Indicates how much the feature contributes to the model prediction. |
|
|
important_features[] |
NA |
List of important features that contribute to the model prediction. |
|
|
latest_evaluation |
|
feature: Indicates the total number of features in the latest evaluation. output: Indicates the total number of outputs in the latest evaluation. status: Indicates the status of the latest evaluation. |
|
|
max_samples |
NA |
Indicates the maximum amount of new data that can be available for an evaluation to run. |
|
|
min_samples |
NA |
Indicates the minimum amount of new data that must be available for an evaluation to run. |
|
|
scheduler |
-latest_evaluation -next_evaluation -repeat_interval -repeat_unit |
latest_evaluation: Indicates when the last evaluation was run. next_evaluation: Indicates when the next evaluation will be run. repeat_interval: Indicates the interval of scheduled evaluations. repeat_unit: Indicates the unit of measurement for scheduled evaluations. |
|
|
status |
NA |
Indicates the status of the latest evaluation. |
|
|
threshold |
-feature -model -output |
feature: Threshold value for the change in value distribution of selected important features. model: Threshold value for selected model. output: Threshold value for how much your model output has changed from when you last trained the model. |
|
|
drift_insights |
prediction_insights |
|
Compares the percentage for different classes of the runtime data versus the training data. runtime: percentage for different classes of the runtime data. training: percentage for different classes of the training data. |
HTTP status codes
For a successful request, the service returns the 200 HTTP status code and provides the response body, as described in the Expected response section.
For unsuccessful requests, the service returns the status codes that are described in the following table:
| HTTP status code | Possible causes |
|---|---|
| 403 | The user has no privilege to get the evaluation result. |
| 404 |
|
| 500 | An error occurred during the retrieval of the drift result. For details about the error, check the logs. |