次の方法で共有


Event Grid のソースとしての Azure Machine Learning

この記事では、Machine Learning ワークスペース イベントのプロパティとスキーマについて説明します。 イベント スキーマの概要については、「Azure Event Grid イベント スキーマ」を参照してください。

使用可能なイベントの種類

Azure Machine Learning から出力されるイベントの種類は次のとおりです。

イベントの種類 説明
Microsoft.MachineLearningServices.ModelRegistered 新しいモデルまたはモデルのバージョンが正常に登録された場合に発生します。
Microsoft.MachineLearningServices.ModelDeployed モデルがエンドポイントに正常にデプロイされたときに発生します。
Microsoft.MachineLearningServices.RunCompleted 実行が正常に完了したときに発生します。
Microsoft.MachineLearningServices.DatasetDriftDetected データセット ドリフト モニターがドリフトを検出したときに発生します。
Microsoft.MachineLearningServices.RunStatusChanged 実行状態が変化したときに発生します。

イベントの例

イベントがトリガーされると、Event Grid サービスにより、そのイベントに関するデータがサブスクライブしているエンドポイントに送信されます。 このセクションには、各イベントでそのデータがどのように見えるかの例が含まれています。

Microsoft.MachineLearningServices.ModelRegistered イベント

[{
  "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}",
  "subject": "models/sklearn_regression_model:20",
  "type": "Microsoft.MachineLearningServices.ModelRegistered",
  "time": "2017-06-26T18:41:00.9584103Z",
  "id": "831e1650-001e-001b-66ab-eeb76e069631",
  "data": {
    "ModelName": "sklearn_regression_model",
    "ModelVersion": 20,
    "ModelTags": {
        "area": "diabetes",
        "type": "regression"
    },
    "ModelProperties": {
        "type": "test"
    }
  },
  "specversion": "1.0"
}]

Microsoft.MachineLearningServices.ModelDeployed イベント

[{
  "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}",
  "subject": "endpoints/my-sklearn-service",
  "type": "Microsoft.MachineLearningServices.ModelDeployed",
  "time": "2017-06-26T18:41:00.9584103Z",
  "id": "831e1650-001e-001b-66ab-eeb76e069631",
  "data": {
    "ServiceName": "my-sklearn-service",
    "ServiceComputeType": "ACI",
    "ModelIds": "sklearn_regression_model:1,sklearn_regression_model:2",
    "ServiceTags": {
        "area": "diabetes",
        "type": "regression"
    },
    "ServiceProperties": {
        "type": "test"
    }
  },
  "specversion": "1.0"
}]

Microsoft.MachineLearningServices.RunCompleted イベント

[{
  "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}",
  "subject": "experiments/0fa9dfaa-cba3-4fa7-b590-23e48548f5c1/runs/AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5",
  "type": "Microsoft.MachineLearningServices.RunCompleted",
  "time": "2017-06-26T18:41:00.9584103Z",
  "id": "831e1650-001e-001b-66ab-eeb76e069631",
  "data": {
    "experimentId": "0fa9dfaa-cba3-4fa7-b590-23e48548f5c1",
    "experimentName": "automl-local-regression",
    "runId": "AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5",
    "runType": null,
    "runTags": {},
    "runProperties": {
        "runTemplate": "automl_child",
        "pipeline_id": "5adc0a4fe02504a586f09a4fcbb241f9a4012062",
        "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\"}",
        "training_percent": "100",
        "predicted_cost": "0.062226144097381045",
        "iteration": "5",
        "run_template": "automl_child",
        "run_preprocessor": "StandardScalerWrapper",
        "run_algorithm": "LassoLars",
        "conda_env_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/conda_env_v_1_0_0.yml",
        "model_name": "AutoMLad912b2d65",
        "scoring_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/scoring_file_v_1_0_0.py",
        "model_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/model.pkl"
    }
  },
  "specversion": "1.0"
}]

Microsoft.MachineLearningServices.DatasetDriftDetected イベント

[{
  "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}",
  "subject": "datadrifts/{}/runs/{}",
  "type": "Microsoft.MachineLearningServices.DatasetDriftDetected",
  "time": "2017-06-26T18:41:00.9584103Z",
  "id": "831e1650-001e-001b-66ab-eeb76e069631",
  "data": {
    "DataDriftId": "01d29aa4-e6a4-470a-9ef3-66660d21f8ef",
    "DataDriftName": "myDriftMonitor",
    "RunId": "01d29aa4-e6a4-470a-9ef3-66660d21f8ef_1571590300380",
    "BaseDatasetId": "3c56d136-0f64-4657-a0e8-5162089a88a3",
    "TargetDatasetId": "d7e74d2e-c972-4266-b5fb-6c9c182d2a74",
    "DriftCoefficient": 0.83503490684792081,
    "StartTime": "2019-07-04T00:00:00+00:00",
    "EndTime": "2019-07-05T00:00:00+00:00"
  },
  "specversion": "1.0"
}]

Microsoft.MachineLearningServices.RunStatusChanged イベント

[{
  "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}",
  "subject": "experiments/0fa9dfaa-cba3-4fa7-b590-23e48548f5c1/runs/AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5",
  "type": "Microsoft.MachineLearningServices.RunStatusChanged",
  "time": "2017-06-26T18:41:00.9584103Z",
  "id": "831e1650-001e-001b-66ab-eeb76e069631",
  "data": {
    "experimentId": "0fa9dfaa-cba3-4fa7-b590-23e48548f5c1",
    "experimentName": "automl-local-regression",
    "runId": "AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5",
    "runType": null,
    "runTags": {},
    "runProperties": {
        "runTemplate": "automl_child",
        "pipeline_id": "5adc0a4fe02504a586f09a4fcbb241f9a4012062",
        "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\"}",
        "training_percent": "100",
        "predicted_cost": "0.062226144097381045",
        "iteration": "5",
        "run_template": "automl_child",
        "run_preprocessor": "StandardScalerWrapper",
        "run_algorithm": "LassoLars",
        "conda_env_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/conda_env_v_1_0_0.yml",
        "model_name": "AutoMLad912b2d65",
        "scoring_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/scoring_file_v_1_0_0.py",
        "model_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/model.pkl"
    },
   "runStatus": "failed"
   },
  "specversion": "1.0"
}]

イベントのプロパティ

イベントのトップレベルのデータを次に示します。

プロパティ タイプ 説明
source 文字列 イベント ソースの完全なリソース パス。 このフィールドは書き込み可能ではありません。 この値は Event Grid によって指定されます。
subject 文字列 発行元が定義したイベントの対象のパス。
type 文字列 このイベント ソース用に登録されたイベントの種類のいずれか。
time 文字列 プロバイダーの UTC 時刻に基づくイベントの生成時刻。
id 文字列 イベントの一意識別子。
data オブジェクト Blob Storage イベントのデータ。
specversion 文字列 CloudEvents スキーマ仕様バージョン。

データ オブジェクトには、イベントの種類ごとに次のプロパティがあります。

Microsoft.MachineLearningServices.ModelRegistered

プロパティ タイプ 説明
ModelName 文字列 登録されたモデルの名前。
ModelVersion 文字列 登録されたモデルのバージョン。
ModelTags オブジェクト 登録されたモデルのタグ。
ModelProperties オブジェクト 登録されたモデルのプロパティ。

Microsoft.MachineLearningServices.ModelDeployed

プロパティ タイプ 説明
ServiceName 文字列 デプロイされたサービスの名前。
ServiceComputeType 文字列 デプロイされたサービスのコンピューティングの種類 (ACI、AKS など)。
ModelIds 文字列 モデル ID のコンマ区切りリスト。 サービスにデプロイされているモデルの ID。
ServiceTags オブジェクト デプロイされたサービスのタグ。
ServiceProperties オブジェクト デプロイされたサービスのプロパティ。

Microsoft.MachineLearningServices.RunCompleted

プロパティ タイプ 説明
experimentId 文字列 実行が属する実験の ID。
experimentName 文字列 実行が属する実験の名前。
runId 文字列 完了した実行の ID。
runType 文字列 完了した実行の種類。
runTags オブジェクト 完了した実行のタグ。
runProperties オブジェクト 完了した実行のプロパティ。

Microsoft.MachineLearningServices.DatasetDriftDetected

プロパティ タイプ 説明
DataDriftId 文字列 イベントをトリガーしたデータ ドリフト モニターの ID。
DataDriftName 文字列 イベントをトリガーしたデータ ドリフト モニターの名前。
RunId 文字列 データ ドリフトを検出した実行の ID。
BaseDatasetId 文字列 ドリフトを検出するために使用される基本データセットの ID。
TargetDatasetId 文字列 ドリフトを検出するために使用されるターゲット データセットの ID。
DriftCoefficient double イベントをトリガーした係数結果。
StartTime datetime ドリフト検出の原因となったターゲット データセット時系列の開始時刻。
EndTime datetime ドリフト検出の原因となったターゲット データセット時系列の終了時刻。

Microsoft.MachineLearningServices.RunStatusChanged

プロパティ タイプ 説明
experimentId 文字列 実行が属する実験の ID。
experimentName 文字列 実行が属する実験の名前。
runId 文字列 完了した実行の ID。
runType 文字列 完了した実行の種類。
runTags オブジェクト 完了した実行のタグ。
runProperties オブジェクト 完了した実行のプロパティ。
runStatus 文字列 実行クの状態。

チュートリアルと方法

タイトル 説明
Azure Machine Learning イベントを使用する Azure Machine Learning と Event Grid の統合の概要です。

次のステップ