Share via


監視部署至實際執行環境的模型效能

適用於:Azure CLI ml 延伸模組 v2 (目前)Python SDK azure-ai-ml v2 (目前)

瞭解如何使用 Azure 機器學習 的模型監視,持續追蹤生產環境中機器學習模型的效能。 模型監視可讓您廣泛檢視監視訊號和警示,以取得潛在問題。 當您監視生產環境中模型的訊號和效能計量時,您可以嚴重評估與其相關聯的固有風險,並找出可能對您的業務造成負面影響的盲點。

在本文中,您將瞭解如何執行下列工作:

  • 針對部署到 Azure 機器學習 在線端點的模型設定現用和進階監視
  • 監視生產環境中模型的效能計量
  • 監視部署在 Azure 外部的模型 機器學習 或部署至 Azure 機器學習 批次端點
  • 使用自訂訊號和計量設定模型監視
  • 解譯監視結果
  • 整合 Azure Machine Learning 模型監視與 Azure 事件方格

必要條件

遵循本文中的步驟之前,請確定您已滿足下列必要條件:

  • Azure 角色型存取控制 (Azure RBAC) 可用來授與 Azure Machine Learning 作業的存取權。 若要執行本文中的步驟,您必須為使用者帳戶指派 Azure Machine Learning 工作區的擁有者參與者角色,或允許 Microsoft.MachineLearningServices/workspaces/onlineEndpoints/* 的自訂角色。 如需詳細資訊,請參閱管理對 Azure Machine Learning 工作區的存取

  • 若要監視部署至 Azure Machine Learning 線上端點的模型 (受控線上端點或 Kubernetes 線上端點),請務必:

  • 若要監視部署至 Azure Machine Learning 批次端點或部署在 Azure Machine Learning 外部的模型,請務必:

    • 有方法可以收集生產資料,並將其註冊為 Azure Machine Learning 資料資產。
    • 持續更新已註冊的資料資產以進行模型監視。
    • (建議) 在 Azure Machine Learning 工作區中註冊模型以進行資料譜系追蹤。

重要

模型監視作業已排程在無伺服器 Spark 計算集區上執行,且支援下列 VM 執行個體類型:Standard_E4s_v3Standard_E8s_v3Standard_E16s_v3Standard_E32s_v3Standard_E64s_v3。 您可以使用 YAML 組態中的 create_monitor.compute.instance_type 屬性,或從 Azure Machine Learning 工作室的下拉式清單中選取 VM 執行個體類型。

設定立即可用的模型監視

假設您將模型部署至 Azure Machine Learning 線上端點中的實際執行環境,並在部署時間啟用資料收集。 在此案例中,Azure Machine Learning 會收集生產推斷資料,並將其自動儲存在 Microsoft Azure Blob 儲存體中。 然後,您可以使用 Azure Machine Learning 模型監視來持續監視此生產推斷資料。

您可以使用 Azure CLI、Python SDK 或工作室進行立即可用的模型監視設定。 立即可用的模型監視組態提供下列監視功能:

  • Azure Machine Learning 會自動偵測與 Azure Machine Learning 線上部署相關聯的生產推斷資料集,並使用資料集進行模型監視。
  • 比較參考資料集會設定為最近的過去生產推斷資料集。
  • 監視設定會自動包含並追蹤內建的監視訊號:資料漂移預測漂移資料品質。 針對每個監視訊號,Azure Machine Learning 會使用:
    • 最近的過去生產推斷資料集作為比較參考資料集。
    • 計量和閾值的智慧預設值。
  • 監視作業排定於每天上午 3:15 (在此範例中) 執行,以取得監視訊號,並根據其對應的閾值評估每個計量結果。 根據預設,當超過任何閾值時,Azure Machine Learning 會將警示電子郵件傳送給設定監視的使用者。

Azure Machine Learning 模型監視會使用 az ml schedule 來排程監視作業。 您可以使用下列 CLI 命令和 YAML 定義來建立立即可用的模型監視:

az ml schedule create -f ./out-of-box-monitoring.yaml

下列 YAML 包含立即可用模型監視的定義。

# out-of-box-monitoring.yaml
$schema:  http://azureml/sdk-2-0/Schedule.json
name: credit_default_model_monitoring
display_name: Credit default model monitoring
description: Credit default model monitoring setup with minimal configurations

trigger:
  # perform model monitoring activity daily at 3:15am
  type: recurrence
  frequency: day #can be minute, hour, day, week, month
  interval: 1 # #every day
  schedule: 
    hours: 3 # at 3am
    minutes: 15 # at 15 mins after 3am

create_monitor:

  compute: # specify a spark compute for monitoring job
    instance_type: standard_e4s_v3
    runtime_version: "3.3"

  monitoring_target: 
    ml_task: classification # model task type: [classification, regression, question_answering]
    endpoint_deployment_id: azureml:credit-default:main # azureml endpoint deployment id

  alert_notification: # emails to get alerts
    emails:
      - abc@example.com
      - def@example.com

設定進階模型監視

Azure Machine Learning 提供許多持續模型監視的功能。 如需這些功能的完整清單,請參閱模型監視的功能。 在許多情況下,您需要使用進階監視功能來設定模型監視。 在下列各節中,您會使用這些功能來設定模型監視:

  • 使用多個監視訊號進行廣泛檢視。
  • 使用歷程記錄模型定型資料或驗證資料作為比較參考資料集。
  • 監視前 N 個最重要的功能和個別功能。

設定特徵重要性

特徵重要性代表每個輸入特徵對模型輸出的相對重要性。 例如,temperature 相較於 elevation,對於模型預測可能更為重要。 啟用特徵重要性可讓您查看不想漂移或避免實際執行環境中發生資料品質問題的功能。

若要啟用任何訊號的特徵重要性 (例如資料漂移或資料品質),您需要提供:

  • 您的定型資料集作為 reference_data 資料集。
  • reference_data.data_column_names.target_column 屬性,這是模型輸出/預測資料行的名稱。

啟用特徵重要性之後,您會看到您在 Azure Machine Learning 模型監視工作室 UI 中所監視每個功能的特徵重要性。

您可以使用 Azure CLI、Python SDK 或工作室來進階設定模型監視。

使用下列 CLI 命令和 YAML 定義建立進階模型監視設定:

az ml schedule create -f ./advanced-model-monitoring.yaml

下列 YAML 包含進階模型監視的定義。

# advanced-model-monitoring.yaml
$schema:  http://azureml/sdk-2-0/Schedule.json
name: fraud_detection_model_monitoring
display_name: Fraud detection model monitoring
description: Fraud detection model monitoring with advanced configurations

trigger:
  # perform model monitoring activity daily at 3:15am
  type: recurrence
  frequency: day #can be minute, hour, day, week, month
  interval: 1 # #every day
  schedule: 
    hours: 3 # at 3am
    minutes: 15 # at 15 mins after 3am

create_monitor:

  compute: 
    instance_type: standard_e4s_v3
    runtime_version: "3.3"

  monitoring_target:
    ml_task: classification
    endpoint_deployment_id: azureml:credit-default:main
  
  monitoring_signals:
    advanced_data_drift: # monitoring signal name, any user defined name works
      type: data_drift
      # reference_dataset is optional. By default referece_dataset is the production inference data associated with Azure Machine Learning online endpoint
      reference_data:
        input_data:
          path: azureml:credit-reference:1 # use training data as comparison reference dataset
          type: mltable
        data_context: training
        data_column_names:
          target_column: DEFAULT_NEXT_MONTH
      features: 
        top_n_feature_importance: 10 # monitor drift for top 10 features
      metric_thresholds:
        numerical:
          jensen_shannon_distance: 0.01
        categorical:
          pearsons_chi_squared_test: 0.02
    advanced_data_quality:
      type: data_quality
      # reference_dataset is optional. By default reference_dataset is the production inference data associated with Azure Machine Learning online endpoint
      reference_data:
        input_data:
          path: azureml:credit-reference:1
          type: mltable
        data_context: training
      features: # monitor data quality for 3 individual features only
        - SEX
        - EDUCATION
      metric_thresholds:
        numerical:
          null_value_rate: 0.05
        categorical:
          out_of_bounds_rate: 0.03

    feature_attribution_drift_signal:
      type: feature_attribution_drift
      # production_data: is not required input here
      # Please ensure Azure Machine Learning online endpoint is enabled to collected both model_inputs and model_outputs data
      # Azure Machine Learning model monitoring will automatically join both model_inputs and model_outputs data and used it for computation
      reference_data:
        input_data:
          path: azureml:credit-reference:1
          type: mltable
        data_context: training
        data_column_names:
          target_column: DEFAULT_NEXT_MONTH
      metric_thresholds:
        normalized_discounted_cumulative_gain: 0.9
  
  alert_notification:
    emails:
      - abc@example.com
      - def@example.com

設定模型效能監視

Azure 機器學習 模型監視可讓您計算其效能計量,以追蹤生產環境中模型的效能。 目前支援下列模型效能計量:

針對分類模型:

  • 精確度
  • 準確率
  • 重新叫用

對於回歸模型:

  • 平均絕對誤差 (MAE)
  • 平均平方誤差 (MSE)
  • 均方根誤差 (RMSE)

更多模型效能監視的必要條件

您必須滿足下列需求,才能設定模型效能訊號:

  • 具有生產模型的輸出數據(模型的預測),每個數據列都有唯一標識碼。 如果您使用 Azure 機器學習 資料收集器收集生產資料correlation_id則會針對每個推斷要求提供 。 使用資料收集器時,您也可以選擇從應用程式記錄自己的唯一標識符。

    注意

    針對 Azure 機器學習 模型效能監視,建議您使用 Azure 機器學習 資料收集器,在自己的數據行中記錄您的唯一標識符。

  • 具有每個數據列唯一標識碼的地面真相數據(實際值)。 指定數據列的唯一標識碼應該符合該特定推斷要求之模型輸出的唯一標識碼。 此唯一標識碼可用來將基礎真相數據集與模型輸出聯結。

    若沒有地面真相數據,您就無法執行模型效能監視。 由於在應用層級遇到地面真相數據,因此您有責任在可用時加以收集。 您也應該在 Azure 機器學習 中維護包含此基本事實數據的數據資產。

  • (選擇性)具有預先聯結的表格式數據集,且模型輸出和已聯結在一起的地面真實數據。

使用數據收集器時監視模型效能需求

如果您使用 Azure 機器學習 資料收集器收集生產推斷數據,而不需為每個數據列提供您自己的唯一標識子作為個別數據行,correlationid系統就會為您自動產生 ,並包含在記錄的 JSON 物件中。 不過,數據收集器會 批次數據列,這些數據列 會在彼此的短時間間隔內傳送。 批次資料列會落在相同的 JSON 物件內,因此會有相同的 correlationid

為了區分相同 JSON 對象中的數據列,Azure 機器學習 模型效能監視會使用索引來判斷 JSON 物件中的數據列順序。 例如,如果三個數據列會批處理在一起,而 correlationidtest,第一列將具有的標識碼,第二列將具有的 test_0標識符 test_1,而第三列的標識碼會是 test_2。 為了確保您的地面真相數據集包含符合所收集生產推斷模型輸出的唯一標識碼,請確定您適當地編製每個 correlationid 索引。 如果記錄的 JSON 物件只有一個資料列,則 correlationid 會是 correlationid_0

若要避免使用此索引編製,建議您在 pandas DataFrame 內,使用 Azure 機器學習 數據收集器記錄自己的數據行中記錄自己的唯一標識符。 然後,在模型監視組態中,您可以指定此資料行的名稱,以將模型輸出數據與您的基礎事實數據聯結。 只要這兩個數據集中的每個數據列標識符都相同,Azure 機器學習 模型監視就可以執行模型效能監視。

監視模型效能的範例工作流程

若要瞭解與模型效能監視相關聯的概念,請考慮此範例工作流程。 假設您要部署模型來預測信用卡交易是否為詐騙,您可以遵循下列步驟來監視模型的效能:

  1. 將您的部署設定為使用數據收集器來收集模型的生產推斷數據(輸入和輸出數據)。 假設輸出數據會儲存在資料行 is_fraud中。
  2. 針對所收集推斷數據的每個數據列,記錄唯一標識符。 唯一識別碼可以來自您的應用程式,或者您可以使用 correlationid Azure 機器學習 針對每個記錄的 JSON 物件唯一產生的 。
  3. 之後,當基礎真相(或實際) is_fraud 數據可供使用時,也會記錄並對應至與模型輸出記錄的相同唯一標識符。
  4. 此基本事實is_fraud數據也會收集、維護及註冊至 Azure 機器學習 作為數據資產。
  5. 使用唯一標識符數據行,建立模型效能監視訊號,以聯結模型的生產推斷和地面真相數據資產。
  6. 最後,計算模型效能計量。

一旦您滿足 模型效能監視的必要條件,您可以使用下列 CLI 命令和 YAML 定義來設定模型監視:

az ml schedule create -f ./model-performance-monitoring.yaml

下列 YAML 包含模型監視的定義,其中包含您已收集的生產推斷資料。

$schema:  http://azureml/sdk-2-0/Schedule.json
name: model_performance_monitoring
display_name: Credit card fraud model performance
description: Credit card fraud model performance

trigger:
  type: recurrence
  frequency: day
  interval: 7 
  schedule: 
    hours: 10
    minutes: 15
  
create_monitor:
  compute: 
    instance_type: standard_e8s_v3
    runtime_version: "3.3"
  monitoring_target:
    ml_task: classification
    endpoint_deployment_id: azureml:loan-approval-endpoint:loan-approval-deployment

  monitoring_signals:
    fraud_detection_model_performance: 
      type: model_performance 
      production_data:
        data_column_names:
          prediction: is_fraud
          correlation_id: correlation_id
      reference_data:
        input_data:
          path: azureml:my_model_ground_truth_data:1
          type: mltable
        data_column_names:
          actual: is_fraud
          correlation_id: correlation_id
        data_context: actuals
      alert_enabled: true
      metric_thresholds: 
        tabular_classification:
          accuracy: 0.95
          precision: 0.8
  alert_notification: 
      emails: 
        - abc@example.com

將生產數據帶入 Azure 機器學習,以設定模型監視

您也可以為部署至 Azure Machine Learning 批次端點或部署在 Azure Machine Learning 外部的模型設定模型監視。 如果您沒有部署,但有生產資料,則可以使用資料來執行持續模型監視。 若要監視這些模型,您必須能夠:

  • 從實際執行環境中部署的模型收集生產推斷資料。
  • 將生產推斷資料註冊為 Azure Machine Learning 資料資產,並確保資料持續更新。
  • 提供自訂資料前置處理元件,並將其註冊為 Azure Machine Learning 元件。

如果您的資料未使用資料收集器收集,則必須提供自訂資料前置處理元件。 如果沒有這個自訂資料前置處理元件,Azure Machine Learning 模型監視系統就不知道如何將您的資料處理成支援時間範圍的表格式格式。

您的自訂前置處理元件必須具有下列輸入和輸出簽章:

輸入/輸出 簽章名稱 類型 描述 範例值
input data_window_start 常值、字串 ISO8601 格式的資料時間範圍開始時間。 2023-05-01T04:31:57.012Z
input data_window_end 常值、字串 ISO8601 格式的資料時間範圍結束時間。 2023-05-01T04:31:57.012Z
input input_data uri_folder 收集的生產推斷資料,其註冊為 Azure Machine Learning 資料資產。 azureml:myproduction_inference_data:1
output preprocessed_data mltable 表格式資料集,其符合參考資料結構描述的子集。

如需自訂資料前置處理元件的範例,請參閱 azuremml-examples GitHub 存放庫中的 custom_preprocessing

滿足上述需求之後,您可以使用下列 CLI 命令和 YAML 定義來設定模型監視:

az ml schedule create -f ./model-monitoring-with-collected-data.yaml

下列 YAML 包含模型監視的定義,其中包含您已收集的生產推斷資料。

# model-monitoring-with-collected-data.yaml
$schema:  http://azureml/sdk-2-0/Schedule.json
name: fraud_detection_model_monitoring
display_name: Fraud detection model monitoring
description: Fraud detection model monitoring with your own production data

trigger:
  # perform model monitoring activity daily at 3:15am
  type: recurrence
  frequency: day #can be minute, hour, day, week, month
  interval: 1 # #every day
  schedule: 
    hours: 3 # at 3am
    minutes: 15 # at 15 mins after 3am

create_monitor:
  compute: 
    instance_type: standard_e4s_v3
    runtime_version: "3.3"
  monitoring_target:
    ml_task: classification
    endpoint_deployment_id: azureml:fraud-detection-endpoint:fraud-detection-deployment
  
  monitoring_signals:

    advanced_data_drift: # monitoring signal name, any user defined name works
      type: data_drift
      # define production dataset with your collected data
      production_data:
        input_data:
          path: azureml:my_production_inference_data_model_inputs:1  # your collected data is registered as Azure Machine Learning asset
          type: uri_folder
        data_context: model_inputs
        pre_processing_component: azureml:production_data_preprocessing:1
      reference_data:
        input_data:
          path: azureml:my_model_training_data:1 # use training data as comparison baseline
          type: mltable
        data_context: training
        data_column_names:
          target_column: is_fraud
      features: 
        top_n_feature_importance: 20 # monitor drift for top 20 features
      metric_thresholds:
        numberical:
          jensen_shannon_distance: 0.01
        categorical:
          pearsons_chi_squared_test: 0.02

    advanced_prediction_drift: # monitoring signal name, any user defined name works
      type: prediction_drift
      # define production dataset with your collected data
      production_data:
        input_data:
          path: azureml:my_production_inference_data_model_outputs:1  # your collected data is registered as Azure Machine Learning asset
          type: uri_folder
        data_context: model_outputs
        pre_processing_component: azureml:production_data_preprocessing:1
      reference_data:
        input_data:
          path: azureml:my_model_validation_data:1 # use training data as comparison reference dataset
          type: mltable
        data_context: validation
      metric_thresholds:
        categorical:
          pearsons_chi_squared_test: 0.02
  
  alert_notification:
    emails:
      - abc@example.com
      - def@example.com

使用自訂訊號和計量設定模型監視

透過 Azure 機器學習 模型監視,您可以定義自定義訊號,並實作您選擇的任何計量來監視模型。 您可以將此自定義訊號註冊為 Azure 機器學習 元件。 當您的 Azure Machine Learning 模型監視作業在指定的排程上執行時,它會計算您在自訂訊號內定義的計量,就像針對預先建置的訊號 (資料漂移、預測漂移和資料品質) 所做的一樣。

若要設定要用於模型監視的自訂訊號,您必須先定義自訂訊號,並將其註冊為 Azure Machine Learning 元件。 Azure Machine Learning 元件必須具有下列輸入和輸出簽章:

元件輸入簽章

元件輸入 DataFrame 應該包含下列項目:

  • 具有前置處理元件中已處理資料的 mltable
  • 任意數目的常值,每個常值都代表已實作計量作為自訂訊號元件的一部分。 例如,如果您已實作計量 std_deviation,則需要 std_deviation_threshold 的輸入。 一般而言,每個計量都應該有一個輸入,名稱為 <metric_name>_threshold
簽章名稱 類型 描述 範例值
production_data mltable 符合參考資料結構描述子集的表格式資料集。
std_deviation_threshold 常值、字串 實作計量的個別閾值。 2

元件輸出簽章

元件輸出連接埠應該具有下列簽章。

簽章名稱 類型 描述
signal_metrics mltable 包含已計算計量的 mltable。 結構描述定義於下一節 signal_metrics 結構描述 中。

signal_metrics schema

元件輸出 DataFrame 應該包含四個資料行:groupmetric_namemetric_valuethreshold_value

簽章名稱 類型 描述 範例值
群組 常值、字串 要套用至此自訂計量的最上層邏輯群組。 TRANSACTIONAMOUNT
metric_name 常值、字串 自訂計量的名稱。 std_deviation
metric_value 數值 自訂計量的值。 44,896.082
threshold_value 數值 自訂計量的閾值。 2

下表顯示計算 std_deviation 計量之自訂訊號元件的範例輸出:

群組 metric_value metric_name threshold_value
TRANSACTIONAMOUNT 44,896.082 std_deviation 2
LOCALHOUR 3.983 std_deviation 2
TRANSACTIONAMOUNTUSD 54,004.902 std_deviation 2
DIGITALITEMCOUNT 7.238 std_deviation 2
PHYSICALITEMCOUNT 5.509 std_deviation 2

若要查看範例自訂訊號元件定義和計量計算程式碼,請參閱 azureml-examples 存放庫中的 custom_signal

一旦您滿足使用自訂訊號和計量的需求,便可以使用下列 CLI 命令和 YAML 定義來設定模型監視:

az ml schedule create -f ./custom-monitoring.yaml

下列 YAML 包含使用自訂訊號進行模型監視的定義。 有關程式碼的一些注意事項:

  • 它假設您已經在 Azure Machine Learning 中使用自訂訊號定義來建立和註冊您的元件。
  • 已註冊自訂訊號元件的 component_idazureml:my_custom_signal:1.0.0
  • 如果您已使用資料收集器收集資料,則可以省略 pre_processing_component 屬性。 如果您想要使用前置處理元件來預先處理資料收集器未收集的生產資料,您可以指定它。
# custom-monitoring.yaml
$schema:  http://azureml/sdk-2-0/Schedule.json
name: my-custom-signal
trigger:
  type: recurrence
  frequency: day # can be minute, hour, day, week, month
  interval: 7 # #every day
create_monitor:
  compute:
    instance_type: "standard_e4s_v3"
    runtime_version: "3.3"
  monitoring_signals:
    customSignal:
      type: custom
      component_id: azureml:my_custom_signal:1.0.0
      input_data:
        production_data:
          input_data:
            type: uri_folder
            path: azureml:my_production_data:1
          data_context: test
          data_window:
            lookback_window_size: P30D
            lookback_window_offset: P7D
          pre_processing_component: azureml:custom_preprocessor:1.0.0
      metric_thresholds:
        - metric_name: std_deviation
          threshold: 2
  alert_notification:
    emails:
      - abc@example.com

解譯監視結果

設定模型監視並完成第一次執行之後,您可以瀏覽回 Azure Machine Learning 工作室中的 [監視] 索引標籤,以檢視結果。

  • 從主要 [監視] 檢視中,選取模型監視的名稱,以查看 [監視概觀] 頁面。 此頁面會顯示對應的模型、端點和部署,以及您所設定訊號的詳細資料。 下一個影像顯示監視儀表板,其中包含資料漂移和資料品質訊號。 視您設定的監視訊號而定,儀表板看起來可能會有所不同。

    顯示監視儀錶板的螢幕快照。

  • 查看儀表板的 [通知] 區段,以查看每個訊號中有哪些功能違反了其個別計量的已設定閾值:

  • 選取 data_drift 以移至資料漂移詳細資料頁面。 在詳細資料頁面上,您可以看到監視組態中所包含每個數值和類別功能的資料漂移計量值。 當您的監視有多個執行時,您會看到每個功能的趨勢線。

    顯示數據漂移訊號詳細數據頁面的螢幕快照。

  • 若要詳細檢視個別功能,請選取功能的名稱,以檢視與參考散發相比的生產分佈。 此檢視也可讓您追蹤該特定功能的漂移時間。

    顯示個別功能數據漂移詳細數據的螢幕快照。

  • 返回監視儀表板,然後選取 [data_quality] 以檢視資料品質訊號頁面。 在此頁面上,您可以看到您所要監視每項功能的 null 值速率、超出界限的速率,以及資料類型錯誤率。

    顯示資料品質訊號詳細數據頁面的螢幕快照。

模型監視是一個連續的程序。 透過 Azure Machine Learning 模型監視,您可以設定多個監視訊號,以取得實際執行環境中模型效能的廣泛檢視。

整合 Azure Machine Learning 模型監視與 Azure 事件方格

您可以使用 Azure Machine Learning 模型監視所產生的事件,透過 Azure 事件方格來設定事件驅動應用程式、處理程序或 CI/CD 工作流程。 您可以透過各種事件處理常式取用事件,例如 Azure 事件中樞、Azure 函式和邏輯應用程式。 根據監視偵測到的漂移,您可以透過程式設計方式採取動作,例如設定機器學習管線來重新定型模型並重新部署模型。

若要開始整合 Azure Machine Learning 模型監視與事件方格:

  1. 請參閱在 Azure 入口網站中設定,並遵循其中的步驟。 為您的事件訂用帳戶指定名稱,例如 MonitoringEvent,然後只 選取 [事件類型] 底下的 [執行狀態已變更] 方塊。

    警告

    請務必針對事件類型選取 [執行狀態已變更]。 請勿選取 [偵測到的資料集漂移],因為它適用於資料漂移 v1,而不是 Azure Machine Learning 模型監視。

  2. 請遵循篩選和訂閱事件中的步驟,為您的案例設定事件篩選。 瀏覽至 [篩選] 索引標籤,然後在 [進階篩選] 底下新增下列索引鍵運算子

    • 金鑰data.RunTags.azureml_modelmonitor_threshold_breached
    • :因為一或多個違反計量閾值的功能而失敗
    • 運算子:字串包含

    透過此篩選,當執行狀態變更 (從 [已完成] 變更為 [失敗],或從 [失敗] 到 [已完成]) 時,就會針對 Azure Machine Learning 工作區內的任何監視產生事件。

  3. 若要在監視層級進行篩選,請在 [進階篩選] 底下使用下列索引鍵運算子

    • 金鑰data.RunTags.azureml_modelmonitor_threshold_breached
    • your_monitor_name_signal_name
    • 運算子:字串包含

    請確定 your_monitor_name_signal_name 是您所要篩選事件特定監視中的訊號名稱。 例如: credit_card_fraud_monitor_data_drift 。 若要讓此篩選正常運作,此字串必須符合監視訊號的名稱。 您應該使用監視名稱和此案例的訊號名稱來命名您的訊號。

  4. 當您完成事件訂用帳戶設定時,請選取所需的端點作為事件處理常式,例如 Azure 事件中樞。

  5. 擷取事件之後,您可以從端點頁面檢視它們:

    顯示從端點頁面檢視的事件螢幕快照。

您也可以在 Azure 監視器的 [計量] 索引標籤中檢視事件:

此螢幕快照顯示從 [Azure 監視器計量] 索引卷標檢視的事件。