Section 4: Bias, Variance, and Hyperparameters

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/14

encourage image

There are no tags or description

Looks like no tags are added yet.

15 Terms

1
New cards

Explain the Bias-Variance Tradeoff

Goal is to minimize the sum of the Bias and Variance

As complexity of the model increases the bias decreases and the variance increases.


At some point, increasing flexibility has little impact on the bias but starts to significantly increase the variance - this is where optimal complexity will be.

<p>Goal is to minimize the sum of the Bias and Variance</p><p>As complexity of the model increases the bias decreases and the variance increases.</p><p></p><p>At some point, increasing flexibility has little impact on the bias but starts to significantly increase the variance - this is where optimal complexity will be. </p>
2
New cards

Explain Bias

Bias refers to the error that is introduced by approximating a real-life problem, which may be extremely complicated, with a much simpler model.

3
New cards

Explain Variance in statistical modeling

Variance refers to the amount by which f^ would change if we estimated it using a different training set.


— How sensitive a model is to changes in its training data

4
New cards

What happens to the predictions at high bias?

  • Predictions are too simple and fail to capture patterns

  • The model makes similar predictions across all inputs (missing complex relationships)


ex: linear model on curved data


5
New cards

What happens to the predictions at low bias?

  • Predictions better fit the training data and follow structure more closely

  • If too low, model may capture random noise (overfitting)

  • Generalization is low


ex: high degree polynomial may perfectly fit training data, but fail on new data


6
New cards

How does dataset size affect variance?

Larger datasets reduce variance because the model generalizes better

Small datasets increase variance and may cause overfitting

7
New cards

How does increasing regularization (Lasso, Ridge) affect bias and variance?

More regularization (higher lambda) - Higher bias, lower variance — simpler model, reduces overfitting

Less regularization (lower lambda) - lower bias, higher variance — complex model, risk of overfitting

8
New cards

How do we balance bias and variance?

  • Regularization (reduce var but increase bias)

  • Feature Selection (reduce overfitting, lowers variance)

  • More data helps reduce variance without increasing bias

  • Model complexity must be tuned to avoid under/over-fitting


9
New cards

What happens to the predictions at high variance?

  • Predictions fluctuate a lot depending on small changes in the training data

  • The model fits noise instead of just the underlying pattern

  • Generalization is low


10
New cards

What happens to the predictions at low variance?

  • Predictions remain consistent, even with different training sets

  • If too low, model may be too simple and miss patterns - also high bias


ex: linear model that generalizes well, but doesn’t capture complex relationships


11
New cards

What is the purpose of regularization in machine learning?

Can you explain lambda?

  • Discourages extreme coefficients

  • Prevents overfitting by adding a penalty term to the loss function


Formula: model error via loss function + lambda * penalty term, where lambda is the regularization parameter → controls the importance between model error and regularization term


<ul><li><p>Discourages extreme coefficients</p></li><li><p>Prevents overfitting by adding a penalty term to the loss function</p></li></ul><p></p><p>Formula: model error via loss function + lambda * penalty term, where lambda is the regularization parameter → controls the importance between model error and regularization term</p><p></p>
12
New cards

How does Ridge regression (L2) modify the loss function?

What are the effects?

It adds the squared magnitude of the coefficients as a penalty term

  • Encourages small, but nonzero coeffs

    • Reduces multicollinearity by distributing weights


<p>It adds the squared magnitude of the coefficients as a penalty term</p><ul><li><p>Encourages small, but nonzero coeffs</p><ul><li><p>Reduces multicollinearity by distributing weights</p></li></ul></li></ul><p></p>
13
New cards

When should you use Ridge Regression?

  • High dimensionality

  • multicollinearity exists in predictors

    • Want to regularize the model but keep all features


14
New cards

How does Lasso Regression (L1) modify the loss function?

What are the effects?

It adds the absolute value of the coefficients as a penalty term.

  • Encourages sparsity by forcing some coeffs to exactly zero

  • Helps with feature selection


<p>It adds the absolute value of the coefficients as a penalty term.</p><ul><li><p>Encourages sparsity by forcing some coeffs to exactly zero</p></li><li><p>Helps with feature selection</p></li></ul><p></p>
15
New cards

When should you use Lasso Regression?

  • Want automatic feature selection

  • When you suspect only a few features matter

  • Need an interpretable model with fewer predictors