Generalization Error

Machine Learning với mô hình dựa trên cây trong Python

Elie Kawerk

Data Scientist

Supervised Learning - Under the Hood

  • Supervised Learning: $y =f(x)$, $f$ is unknown.

noisy-ds

Machine Learning với mô hình dựa trên cây trong Python

Goals of Supervised Learning

  • Find a model $\hat{f}$ that best approximates $f$: $\hat{f} \approx f$

  • $\hat{f}$ can be Logistic Regression, Decision Tree, Neural Network ...

  • Discard noise as much as possible.

  • End goal: $\hat{f}$ should achieve a low predictive error on unseen datasets.

Machine Learning với mô hình dựa trên cây trong Python

Difficulties in Approximating $f$

  • Overfitting:

    $\hat{f}(x)$ fits the training set noise.

  • Underfitting:

    $\hat{f}$ is not flexible enough to approximate $f$.

Machine Learning với mô hình dựa trên cây trong Python

Overfitting

overfit

Machine Learning với mô hình dựa trên cây trong Python

Underfitting

underfit

Machine Learning với mô hình dựa trên cây trong Python

Generalization Error

  • Generalization Error of $\hat{f}$: Does $\hat{f}$ generalize well on unseen data?

  • It can be decomposed as follows:

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

Machine Learning với mô hình dựa trên cây trong Python

Bias

  • Bias: error term that tells you, on average, how much $\hat{f} \neq f$.

high-bias

Machine Learning với mô hình dựa trên cây trong Python

Variance

  • Variance: tells you how much $\hat{f}$ is inconsistent over different training sets.

high-variance

Machine Learning với mô hình dựa trên cây trong Python

Model Complexity

  • Model Complexity: sets the flexibility of $\hat{f}$.

  • Example: Maximum tree depth, Minimum samples per leaf, ...

Machine Learning với mô hình dựa trên cây trong Python

Bias-Variance Tradeoff

gener-decomposition

Machine Learning với mô hình dựa trên cây trong Python

Bias-Variance Tradeoff: A Visual Explanation

bias-variance-visual

Machine Learning với mô hình dựa trên cây trong Python

Let's practice!

Machine Learning với mô hình dựa trên cây trong Python

Preparing Video For Download...