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.

Table 1. Supported parameters in the response body

This table lists the parameters and the description of the fields available in the response body for the Get Single Drift Result API.

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.

  • manual - is done on a need basis.
  • scheduler - is a transaction collection.

drift_scores

feature_drift:

  • feature1
  • feature2
  • ... ...

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.

  • js: - Jensen Shannon
  • tvd: - total variation distance
  • oc: - overlap coefficient

tvd: [tvd_score, true/false]

oc: [oc_score, true/false]

output_drift

  • prediction:{}
  • probability:{}

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.

  • js: - Jensen Shannon
  • tvd: - total variation distance
  • oc: - overlap coefficient

tvd: [tvd_score, true/false]

oc: [oc_score, true/false]

drift_insights

output_insights

output1

  • runtime:
    • max: 1,
    • min: 0.38
    • x: {
      • max: 1
      • min: 0.26:
      }
    • y: []
  • training:
    • max: 1,
    • min: 0.26
    • x: {
      • max: 1
      • min: 0.26
      }
    • y: []

output2:

... ...

Indicates the following distribution and significance details for each output insight:

  • distribution - stores the data that the drift insight uses to draw the density distribution figure of runtime and training for the output. In distribution, it records the bounder of x-axis and all the values of y-axis of the graph.

    • max - the highest value of the output in the runtime data or the training data records.
    • min - the lowest value of the output in the runtime data or the training data records.

    The x key represents the x-axis for the runtime data density distribution. The minimum and maximum values for the x key are derived from the minimum and maximum values of both the runtime data and the training data.

    The y key is the runtime data density distribution.

  • significance - stores the data that the drift insight uses to draw the histogram of the output intervals.

    • absolute_percentage_change - the change in the percentage of record numbers between training and runtime.

    • lower_bounder - the lower limit of the interval.

    • runtime_count - the number of runtime data records in the interval.

    • runtime_percentage - the percentage of the runtime data in the interval in all the runtime data.

    • training_count - the number of training data records in the interval.

    • training_percentage - the percentage of the training data in the interval in all the training data.

    • upper_bounder - the maximum limit of the interval.

feature_insights

Categorical_feature1:

categories:[]

distribution:

  • -runtime_count:[]
  • -training_count:[]

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.

  • runtime_count - the number of the feature’s each value in the runtime data records.

  • training_count - the number of the feature’s each value in the training data records.

Continuous_feature:

distribution:

  • runtime:
    • max: 1,
    • min: 0.38
    • x: {
      • max: 1
      • min: 0.26:
      }
    • y: []
  • training:
    • max: 1,
    • min: 0.26
    • x: {
      • max: 1
      • min: 0.26
      }
    • y: []

Indicates the feature insight based on the Continuous_feature.

  • distribution - stores the data that the drift insight uses to draw the density distribution figure of runtime and training for the feature. In distribution, it records the bounder of x-axis and all the values of y-axis of the graph.

    • max - the highest value of the feature in the runtime data or the training data records.

    • min - the lowest value of the feature in the runtime data or the training data records.

    The x key represents the x-axis for the runtime data density distribution. The minimum and maximum values for the x key are derived from the minimum and maximum values of both the runtime data and the training data.

    The y key is the runtime data density distribution.

significance:

decreased_intervals:

  • absolute_percentage_change
  • lower_bounder
  • runtime_count
  • runtime_percentage
  • training_count
  • training_percentage
  • upper_bounder

increased_intervals:

  • absolute_percentage_change
  • lower_bounder
  • runtime_count
  • runtime_percentage
  • training_count
  • training_percentage
  • upper_bounder
  • significance- stores the data that the drift insight uses to draw the histogram of the feature insights.

    • absolute_percentage_change - the change in the percentage of record numbers between training and runtime.

    • lower_bounder - the lower limit of the interval.

    • runtime_count - the number of runtime data records in the interval.

    • runtime_percentage - the percentage of the runtime data in the interval in all the runtime data.

    • training_count - the number of training data records in the interval.

    • training_percentage - the percentage of the training data in the interval in all the training data.

    • upper_bounder - the maximum limit of the interval.

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

  • issues
    • feature
    • output
  • status

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

  • runtime
    • class_1
    • class_2
    • … ...
  • training
    • class_1
    • class_2
    • … ...

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:

Table 2. HTTP status code descriptions
HTTP status code Possible causes
403 The user has no privilege to get the evaluation result.
404
  • Failed to retrieve the drift evaluation result.
  • The monitor does not exist.
500 An error occurred during the retrieval of the drift result. For details about the error, check the logs.