

我們不再更新 Amazon Machine Learning 服務或接受新使用者。本文件可供現有使用者使用，但我們不再更新。如需詳細資訊，請參閱[什麼是 Amazon Machine Learning](https://docs.aws.amazon.com/machine-learning/latest/dg/what-is-amazon-machine-learning.html)。

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

# 步驟 4：檢閱 ML 模型的預測效能並設定分數閾值
<a name="step-4-review-model-and-set-cutoff"></a>

 現在您已建立 ML 模型，且 Amazon Machine Learning (Amazon ML) 已對其進行評估，讓我們來看看它是否足夠使用。在評估期間，Amazon ML 計算了一個產業標準品質指標，稱為曲線下面積 (AUC) 指標，可表達 ML 模型的效能品質。Amazon ML 也會解譯 AUC 指標，以告訴您 ML 模型的品質是否適用於大多數機器學習應用程式。(請至[衡量 ML 模型準確性](binary-model-insights.md#measuring-ml-model-accuracy)進一步了解 AUC)。讓我們檢閱 AUC 指標，然後調整分數閾值或分界值以最佳化模型的預測效能。

**檢閱 ML 模型的 AUC 指標**

1.  在 **ML model summary (ML 模型摘要)** 頁面的 **ML model report (ML 模型報告)** 導覽窗格中，選擇 **Evaluations (評估)**、選擇 **Evaluation: ML model: Banking model 1 (評估：ML 模型：Banking model 1)**，然後選擇 **Summary (摘要)**。

1.  在 **Evaluation summary (評估摘要)** 頁面上，檢閱評估摘要，包括模型的 AUC 效能指標。  
![\[ML model performance metric showing extremely good quality score with AUC of 0.94.\]](http://docs.aws.amazon.com/zh_tw/machine-learning/latest/dg/images/image24.png)

 ML 模型會為預測資料來源中的每個記錄各產生數值預測分數，然後套用閾值以將這些分數轉換為 0 (否) 或 1 (是) 的二元標籤。透過變更 *score threshold (分數閾值)*，您可以調整 ML 模型指派這些標籤的方式。現在，設定分數閾值。

 **為 ML 模型設定分數閾值** 

1.  在 **Evaluation Summary (評估摘要)** 頁面上，選擇 **Adjust Score Threshold (調整分數閾值)**。  
![\[ML model performance chart showing predicted distributions for "1" and "0" records with adjustable score threshold.\]](http://docs.aws.amazon.com/zh_tw/machine-learning/latest/dg/images/image25.png)

   您可以透過調整分數閾值來微調 ML 模型的效能指標。調整這個值會改變模型在預測中必須具備的可信度等級，用以將某個預測視為陽性。也會改變您願意在預測中容忍多少偽陽性和偽陰性結果。

    您可以透過增加分數閾值來控制模型會將哪些考慮為陽性預測的分界值，直到模型只將具有最高真陽性可能性的預測看作是陽性的。您也可以降低分數閾值，直到您不再有任何偽陽性。選擇您的分界值，以反映您的業務需求。在本教學課程中，每個偽陽性都會花費行銷活動資金，所以我們希望真陽性的比例高於偽陽性。

1. 舉例來說，您想要鎖定會訂閱產品的前 3% 客戶。滑動垂直選取器，將分數閾值設定至對應到 **3% of the records are predicted as "1" (3% 的記錄會預測為「1」)** 的值。  
![\[ML model performance chart showing distribution of predicted answers for "1" and "0" records.\]](http://docs.aws.amazon.com/zh_tw/machine-learning/latest/dg/images/image26.png)

    請注意，此分數閾值對 ML 模型效能的影響：偽陽性率為 0.007。假設此偽陽性率是可接受的值。

1.  選擇 **Save score threshold at 0.77 (將分數閾值儲存在 0.77)**。

每當您使用此 ML 模型來進行預測，它會將分數超過 0.77 的記錄預測為「1」，其餘記錄預測為「0」。

若要進一步了解分數閾值，請參閱[二元分類](binary-classification.md)。

現在您已準備好要開始[使用您的模型建立預測](step-5-create-predictions.md)。