1. 案例定位

R Logistic Regression 與 Exercise 11.2。

2. 學習目標

以 R 建立 Binary Outcome Model,產生 Prediction 並用 ROC/AUC 評估。

3. 案例情境

原書展示 R ROC Curve with AUC,並要求以 employee_attrition Dataset 建 Logistic Regression。

4. 開始資料

Figure 11.15、Exercise 11.2、employee_attrition Dataset。

5. 分析方法

Fit Model → Predict Probability/Class → Confusion Matrix/ROC → Interpret。

6. 計算結果

Exercise 11.2 實際數值需由 R Output 產生;原書題目不提供固定答案。

7. 結果分析與管理解讀

ROC/AUC 提供 Threshold-independent 的分類能力視角,但仍需結合 Business Error Costs。

8. AI Prompt

建立 Exercise 11.2 的 R 結果解讀模板,不填入未實際運算的 Metrics。

9. 思考/What-if

AUC 高是否代表所有 Classification Threshold 都適合?

參考解答: 否;實際 Threshold 還需依 False Positive/False Negative 的業務代價選擇。

10. 資料說明