Generalization Error

Machine Learning with Tree-Based Models in Python

Elie Kawerk

Data Scientist

Supervised Learning - เบื้องหลัง

  • Supervised Learning: $y =f(x)$, $f$ ไม่ทราบค่า

noisy-ds

Machine Learning with Tree-Based Models in Python

เป้าหมายของ Supervised Learning

  • หา $\hat{f}$ ที่ประมาณค่า $f$ ได้ดีที่สุด: $\hat{f} \approx f$

  • $\hat{f}$ อาจเป็น Logistic Regression, Decision Tree, Neural Network ...

  • กำจัด noise ให้มากที่สุด

  • เป้าหมาย: $\hat{f}$ ควรมี predictive error ต่ำบนข้อมูลที่ไม่เคยเห็น

Machine Learning with Tree-Based Models in Python

ปัญหาในการประมาณค่า $f$

  • Overfitting:

    $\hat{f}(x)$ ปรับตัวตาม noise ในชุดฝึก

  • Underfitting:

    $\hat{f}$ ไม่ยืดหยุ่นพอที่จะประมาณค่า $f$

Machine Learning with Tree-Based Models in Python

Overfitting

overfit

Machine Learning with Tree-Based Models in Python

Underfitting

underfit

Machine Learning with Tree-Based Models in Python

Generalization Error

  • Generalization Error ของ $\hat{f}$: $\hat{f}$ generalize ได้ดีบนข้อมูลใหม่หรือไม่?

  • แยกย่อยได้ดังนี้:

    Generalization Error ของ $\hat{f} = bias^2 + variance + \text{irreducible error}$

Machine Learning with Tree-Based Models in Python

Bias

  • Bias: ค่าความผิดพลาดที่บอกว่าโดยเฉลี่ย $\hat{f}$ ต่างจาก $f$ มากแค่ไหน

high-bias

Machine Learning with Tree-Based Models in Python

Variance

  • Variance: บอกว่า $\hat{f}$ มีความสม่ำเสมอแค่ไหนเมื่อเปลี่ยนชุดข้อมูลฝึก

high-variance

Machine Learning with Tree-Based Models in Python

Model Complexity

  • Model Complexity: กำหนดความยืดหยุ่นของ $\hat{f}$

  • ตัวอย่าง: Maximum tree depth, Minimum samples per leaf, ...

Machine Learning with Tree-Based Models in Python

Bias-Variance Tradeoff

gener-decomposition

Machine Learning with Tree-Based Models in Python

Bias-Variance Tradeoff: ภาพรวมแบบเห็นชัด

bias-variance-visual

Machine Learning with Tree-Based Models in Python

มาฝึกกันเถอะ!

Machine Learning with Tree-Based Models in Python

Preparing Video For Download...