

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 偏差偏離違規
<a name="clarify-model-monitor-bias-drift-violations"></a>

偏差偏離工作會根據目前 `MonitoringExecution` 的分析結果，評估[基準組態](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateModelBiasJobDefinition.html#sagemaker-CreateModelBiasJobDefinition-request-ModelBiasBaselineConfig)提供的基準限制條件。如果偵測到違規，工作會將其列於執行輸出位置中的 *constraint\$1violations.json* 檔案，並將執行狀態標記為 [解讀結果](model-monitor-interpreting-results.md)。

以下是偏差偏離違規檔案的結構描述。
+ `facet` – 構面的名稱，由監控工作分析組態構面 `name_or_index` 提供。
+ `facet_value` – 構面的值，由監控工作分析組態構面 `value_or_threshold` 提供。
+ `metric_name` – 偏差指標的簡短名稱。例如，“CI” 表示類別不平衡。如需每個訓練前偏差指標的簡短名稱，請參閱[訓練前偏差指標](clarify-measure-data-bias.md)，如需每個訓練後偏差指標的簡短名稱，請參閱[訓練後資料和模型偏差指標](clarify-measure-post-training-bias.md)。
+ `constraint_check_type` – 監控的違規類型。目前僅支援 `bias_drift_check`。
+ `description` – 說明違規的描述訊息。

```
{
    "version": "1.0",
    "violations": [{
        "facet": "string",
        "facet_value": "string",
        "metric_name": "string",
        "constraint_check_type": "string",
        "description": "string"
    }]
}
```

偏差指標用於測量分佈中的相等程度。接近零的值表示分佈較為平衡。如果工作分析結果檔案 (analysis.json) 中偏差指標的值低於其在基準限制檔案中的對應值，則會記錄違規。例如，如果 DPPL 偏差指標的基準限制條件為 `0.2`，且分析結果為 `0.1`，則不會記錄違規，因為 `0.1` 比 `0.2` 更接近 `0`。但是，如果分析結果為 `-0.3`，則會記錄違規，因為比 `0.2` 的基準限制條件更遠於 `0`。

```
{
    "version": "1.0",
    "violations": [{
        "facet": "Age",
        "facet_value": "40",
        "metric_name": "CI",
        "constraint_check_type": "bias_drift_check",
        "description": "Value 0.0751544567666083 does not meet the constraint requirement"
    }, {
        "facet": "Age",
        "facet_value": "40",
        "metric_name": "DPPL",
        "constraint_check_type": "bias_drift_check",
        "description": "Value -0.0791244970125596 does not meet the constraint requirement"
    }]
}
```