本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
constraints.json 檔案是用來表達資料集必須滿足的限制條件。Amazon SageMaker Model Monitor 容器可以使用 constraints.json 檔案來評估資料集。預先建置的容器能夠為基準資料集自動產生 constraints.json 檔案。如果您使用自有容器,則可以在容器中提供類似的功能,或者,您可以用其他方式建立 constraints.json 檔案。以下是預先建置的容器所使用的限制條件檔案的結構描述。使用自有容器可以採用相同的格式,或依需要來增強。
{
"version": 0,
"features":
[
{
"name": "string",
"inferred_type": "Integral" | "Fractional" |
| "String" | "Unknown",
"completeness": number,
"num_constraints":
{
"is_non_negative": boolean
},
"string_constraints":
{
"domains":
[
"list of",
"observed values",
"for small cardinality"
]
},
"monitoringConfigOverrides":
{}
}
],
"monitoring_config":
{
"evaluate_constraints": "Enabled",
"emit_metrics": "Enabled",
"datatype_check_threshold": 0.1,
"domain_content_threshold": 0.1,
"distribution_constraints":
{
"perform_comparison": "Enabled",
"comparison_threshold": 0.1,
"comparison_method": "Simple"||"Robust",
"categorical_comparison_threshold": 0.1,
"categorical_drift_method": "LInfinity"||"ChiSquared"
}
}
}
monitoring_config
物件包含用於監控功能工作的選項。下表描述各個選項。
監控限制條件
限制條件 | 描述 |
---|---|
evaluate_constraints |
有效值: 預設: |
emit_metrics |
有效值: 預設: |
datatype_check_threshold |
如果臨界值高於 在基準步驟期間,產生的限制條件會針對每個欄,建議推斷的資料類型。您可以調校 有效值:浮點數 預設:0.1 |
domain_content_threshold |
如果目前資料集的某個字串欄位的未知值比基準資料集更多,則可以使用此臨界值來決定是否需要標記為違規。 有效值:浮點數 預設:0.1 |
distribution_constraints |
perform_comparison
有效值: 預設: |
comparison_threshold
如果臨界值高於 有效值:浮點數 預設:0.1 |
|
comparison_method
是否計算 有效值: |
|
categorical_comparison_threshold 選用。設定分類特徵的閾值。如果資料集中的值超過您設定的閾值,違規會記錄在違規報告中。 有效值:浮點數 預設值:指派給 |
|
categorical_drift_method 選用。對於分類特徵,指定用於偵測分佈偏離的計算方法。如果您沒有設定此參數,系統會使用 K-S (Linfinity) 測試。 有效值: 預設: |