|
| 1 | +--- |
| 2 | +title: Azure Event Grid Machine Learning event schema |
| 3 | +description: Describes the properties that are provided for Machine Learning Workspace events with Azure Event Grid |
| 4 | +services: event-grid |
| 5 | +author: jenns |
| 6 | + |
| 7 | +ms.service: event-grid |
| 8 | +ms.topic: reference |
| 9 | +ms.date: 10/18/2019 |
| 10 | +ms.author: jenns |
| 11 | +--- |
| 12 | + |
| 13 | +# Azure Event Grid event schema for Azure Machine Learning |
| 14 | + |
| 15 | +This article provides the properties and schema for machine learning workspace events. For an introduction to event schemas, see [Azure Event Grid event schema](event-schema.md). |
| 16 | + |
| 17 | +For a list of sample scripts and tutorials, see [AzureML event source](event-sources.md#azure-machine-learning). |
| 18 | + |
| 19 | +## Available event types |
| 20 | + |
| 21 | +Azure Machine Learning emits the following event types: |
| 22 | + |
| 23 | +| Event type | Description | |
| 24 | +| ---------- | ----------- | |
| 25 | +| Microsoft.MachineLearningServices.ModelRegistered | Raised when a new Model or Model version has been successfully registered. | |
| 26 | +| Microsoft.MachineLearningServices.ModelDeployed | Raised when Model(s) have been successfully deployed to an Endpoint. | |
| 27 | +| Microsoft.MachineLearningServices.RunCompleted | Raised when a Run has been successfully completed. | |
| 28 | +| Microsoft.MachineLearningServices.DatasetDriftDetected | Raised when a Dataset drift monitor detects drift. | |
| 29 | + |
| 30 | +## The contents of an event response |
| 31 | + |
| 32 | +When an event is triggered, the Event Grid service sends data about that event to subscribing endpoint. |
| 33 | + |
| 34 | +This section contains an example of what that data would look like for each event. |
| 35 | + |
| 36 | +### Microsoft.MachineLearningServices.ModelRegistered event |
| 37 | + |
| 38 | +```json |
| 39 | +[{ |
| 40 | + "topic": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}", |
| 41 | + "subject": "models/sklearn_regression_model:20", |
| 42 | + "eventType": "Microsoft.MachineLearningServices.ModelRegistered", |
| 43 | + "eventTime": "2017-06-26T18:41:00.9584103Z", |
| 44 | + "id": "831e1650-001e-001b-66ab-eeb76e069631", |
| 45 | + "data": { |
| 46 | + "ModelName": "sklearn_regression_model", |
| 47 | + "ModelVersion": 20, |
| 48 | + "ModelTags": { |
| 49 | + "area": "diabetes", |
| 50 | + "type": "regression" |
| 51 | + }, |
| 52 | + "ModelProperties": { |
| 53 | + "type": "test" |
| 54 | + } |
| 55 | + }, |
| 56 | + "dataVersion": "", |
| 57 | + "metadataVersion": "1" |
| 58 | +}] |
| 59 | +``` |
| 60 | + |
| 61 | +### Microsoft.MachineLearningServices.ModelDeployed event |
| 62 | + |
| 63 | +```json |
| 64 | +[{ |
| 65 | + "topic": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}", |
| 66 | + "subject": "endpoints/my-sklearn-service", |
| 67 | + "eventType": "Microsoft.MachineLearningServices.ModelDeployed", |
| 68 | + "eventTime": "2017-06-26T18:41:00.9584103Z", |
| 69 | + "id": "831e1650-001e-001b-66ab-eeb76e069631", |
| 70 | + "data": { |
| 71 | + "ServiceName": "my-sklearn-service", |
| 72 | + "ServiceComputeType": "ACI", |
| 73 | + "ModelIds": "sklearn_regression_model:1,sklearn_regression_model:2", |
| 74 | + "ServiceTags": { |
| 75 | + "area": "diabetes", |
| 76 | + "type": "regression" |
| 77 | + }, |
| 78 | + "ServiceProperties": { |
| 79 | + "type": "test" |
| 80 | + } |
| 81 | + }, |
| 82 | + "dataVersion": "", |
| 83 | + "metadataVersion": "1" |
| 84 | +}] |
| 85 | +``` |
| 86 | + |
| 87 | +### Microsoft.MachineLearningServices.RunCompleted event |
| 88 | + |
| 89 | +```json |
| 90 | +[{ |
| 91 | + "topic": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}", |
| 92 | + "subject": "experiments/0fa9dfaa-cba3-4fa7-b590-23e48548f5c1/runs/AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5", |
| 93 | + "eventType": "Microsoft.MachineLearningServices.RunCompleted", |
| 94 | + "eventTime": "2017-06-26T18:41:00.9584103Z", |
| 95 | + "id": "831e1650-001e-001b-66ab-eeb76e069631", |
| 96 | + "data": { |
| 97 | + "ExperimentId": "0fa9dfaa-cba3-4fa7-b590-23e48548f5c1", |
| 98 | + "ExperimentName": "automl-local-regression", |
| 99 | + "RunId": "AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5", |
| 100 | + "RunType": null, |
| 101 | + "RunTags": {}, |
| 102 | + "RunProperties": { |
| 103 | + "runTemplate": "automl_child", |
| 104 | + "pipeline_id": "5adc0a4fe02504a586f09a4fcbb241f9a4012062", |
| 105 | + "pipeline_spec": "{\"objects\": [{\"class_name\": \"StandardScaler\", \"module\": \"sklearn.preprocessing\", \"param_args\": [], \"param_kwargs\": {\"with_mean\": true, \"with_std\": false}, \"prepared_kwargs\": {}, \"spec_class\": \"preproc\"}, {\"class_name\": \"LassoLars\", \"module\": \"sklearn.linear_model\", \"param_args\": [], \"param_kwargs\": {\"alpha\": 0.001, \"normalize\": true}, \"prepared_kwargs\": {}, \"spec_class\": \"sklearn\"}], \"pipeline_id\": \"5adc0a4fe02504a586f09a4fcbb241f9a4012062\"}", |
| 106 | + "training_percent": "100", |
| 107 | + "predicted_cost": "0.062226144097381045", |
| 108 | + "iteration": "5", |
| 109 | + "run_template": "automl_child", |
| 110 | + "run_preprocessor": "StandardScalerWrapper", |
| 111 | + "run_algorithm": "LassoLars", |
| 112 | + "conda_env_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/conda_env_v_1_0_0.yml", |
| 113 | + "model_name": "AutoMLad912b2d65", |
| 114 | + "scoring_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/scoring_file_v_1_0_0.py", |
| 115 | + "model_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/model.pkl" |
| 116 | + } |
| 117 | + }, |
| 118 | + "dataVersion": "", |
| 119 | + "metadataVersion": "1" |
| 120 | +}] |
| 121 | +``` |
| 122 | + |
| 123 | +### Microsoft.MachineLearningServices.DatasetDriftDetected event |
| 124 | + |
| 125 | +```json |
| 126 | +[{ |
| 127 | + "topic": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}", |
| 128 | + "subject": "datadrifts/{}/runs/{}", |
| 129 | + "eventType": "Microsoft.MachineLearningServices.DatasetDriftDetected", |
| 130 | + "eventTime": "2017-06-26T18:41:00.9584103Z", |
| 131 | + "id": "831e1650-001e-001b-66ab-eeb76e069631", |
| 132 | + "data": { |
| 133 | + "DataDriftId": "01d29aa4-e6a4-470a-9ef3-66660d21f8ef", |
| 134 | + "DataDriftName": "myDriftMonitor", |
| 135 | + "RunId": "01d29aa4-e6a4-470a-9ef3-66660d21f8ef_1571590300380", |
| 136 | + "BaseDatasetId": "3c56d136-0f64-4657-a0e8-5162089a88a3", |
| 137 | + "TargetDatasetId": "d7e74d2e-c972-4266-b5fb-6c9c182d2a74", |
| 138 | + "DriftCoefficient": 0.83503490684792081, |
| 139 | + "StartTime": "2019-07-04T00:00:00+00:00", |
| 140 | + "EndTime": "2019-07-05T00:00:00+00:00" |
| 141 | + }, |
| 142 | + "dataVersion": "", |
| 143 | + "metadataVersion": "1" |
| 144 | +}] |
| 145 | +``` |
| 146 | + |
| 147 | +## Event properties |
| 148 | + |
| 149 | +An event has the following top-level data: |
| 150 | + |
| 151 | +| Property | Type | Description | |
| 152 | +| -------- | ---- | ----------- | |
| 153 | +| topic | string | Full resource path to the event source. This field is not writeable. Event Grid provides this value. | |
| 154 | +| subject | string | Publisher-defined path to the event subject. | |
| 155 | +| eventType | string | One of the registered event types for this event source. | |
| 156 | +| eventTime | string | The time the event is generated based on the provider's UTC time. | |
| 157 | +| id | string | Unique identifier for the event. | |
| 158 | +| data | object | Blob storage event data. | |
| 159 | +| dataVersion | string | The schema version of the data object. The publisher defines the schema version. | |
| 160 | +| metadataVersion | string | The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value. | |
| 161 | + |
| 162 | +The data object has the following properties for each event type: |
| 163 | + |
| 164 | +### Microsoft.MachineLearningServices.ModelRegistered |
| 165 | + |
| 166 | +| Property | Type | Description | |
| 167 | +| -------- | ---- | ----------- | |
| 168 | +| ModelName | string | The name of the model that was registered. | |
| 169 | +| ModelVersion | int | The version of the model that was registered. | |
| 170 | +| ModelTags | object | The tags of the model that was registered. | |
| 171 | +| ModelProperties | object | The properties of the model that was registered. | |
| 172 | + |
| 173 | +### Microsoft.MachineLearningServices.ModelDeployed |
| 174 | + |
| 175 | +| Property | Type | Description | |
| 176 | +| -------- | ---- | ----------- | |
| 177 | +| ServiceName | string | The name of the deployed service. | |
| 178 | +| ServiceComputeType | string | The compute type (e.g. ACI, AKS) of the deployed service. | |
| 179 | +| ModelIds | string | A common separated list of model IDs. The IDs of the models deployed in the service. | |
| 180 | +| ServiceTags | object | The tags of the deployed service. | |
| 181 | +| ServiceProperties | object | The properties of the deployed service. | |
| 182 | + |
| 183 | +### Microsoft.MachineLearningServices.RunCompleted |
| 184 | + |
| 185 | +| Property | Type | Description | |
| 186 | +| -------- | ---- | ----------- | |
| 187 | +| ExperimentId | string | The ID of the experiment that the run belongs to. | |
| 188 | +| ExperimentName | string | The name of the experiment that the run belongs to. | |
| 189 | +| RunId | string | The ID of the Run that was completed. | |
| 190 | +| RunType | string | The Run Type of the completed Run. | |
| 191 | +| RunTags | object | The tags of the completed Run. | |
| 192 | +| RunProperties | object | The properties of the completed Run. | |
| 193 | + |
| 194 | +### Microsoft.MachineLearningServices.DatasetDriftDetected |
| 195 | + |
| 196 | +| Property | Type | Description | |
| 197 | +| -------- | ---- | ----------- | |
| 198 | +| DataDriftId | string | The ID of the data drift monitor that triggered the event. | |
| 199 | +| DataDriftName | string | The name of the data drift monitor that triggered the event. | |
| 200 | +| RunId | string | The ID of the Run that detected data drift. | |
| 201 | +| BaseDatasetId | string | The ID of the base Dataset used to detect drift. | |
| 202 | +| TargetDatasetId | string | The ID of the target Dataset used to detect drift. | |
| 203 | +| DriftCoefficient | double | The coefficient result that triggered the event. | |
| 204 | +| StartTime | datetime | The start time of the target dataset time series that resulted in drift detection. | |
| 205 | +| EndTime | datetime | The end time of the target dataset time series that resulted in drift detection. | |
| 206 | + |
| 207 | + |
| 208 | +## Next steps |
| 209 | + |
| 210 | +* For an introduction to Azure Event Grid, see [What is Event Grid?](overview.md) |
| 211 | +* For more information about creating an Azure Event Grid subscription, see [Event Grid subscription schema](subscription-creation-schema.md) |
| 212 | +* For an introduction to using Azure Event Grid with Azure Machine Learning, see [Consume Azure Machine Learning events](/azure/machine-learning/service/concept-event-grid-integration) |
| 213 | +* For an example of using Azure Event Grid with Azure Machine Learning, see [Create event driven machine learning workflows](/azure/machine-learning/service/event-schema-machine-learning) |
0 commit comments