ML Flashcards

1
Q

What is bias in ML models?

A

Bias is the difference between the average model prediction and the ground truth. A model with high bias makes strong assumptions about the underlying patterns in the data, and these assumptions may not accurately reflect the true relationship between the input features and the target variable.

Think of the bullseye visualization. High bias means the data points are off center, low bias means they’re centered.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is variance in ML models?

A

Model variance refers to the sensitivity of a model to the variations in the training data. Specifically, model variance measures how much the model’s predictions fluctuate when trained on different subsets of the training data.

Think of the bullseye visualization. High variance means the data points are spread out, low variance means they’re tightly clustered.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe the bias-variance tradeoff.

A

First, decreasing bias increases variance and vice versa, i.e. low bias models have very high variance and vice versa. Total error is a function of bias, variance, and irreducible error. To get the minimum error, we need to find the right compromise between bias and variance (think of the graph with the bias and variance curves and the sum of them. The sum is a U).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the downsides of high bias / high variance ML models?

A

High bias models underfit the data and tend to be too simple, while high variance models overfit the data and tend to be too complex (have too many parameters).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you identify high bias and high variance models?

A

High bias models have low accuracy on both train and test sets. High variance models have high accuracy on train set but low accuracy on test (because they overfit and fail to generalize).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you select the model (high bias or high variance) based on the training data size?

A

For small data, I would prefer a high bias model. This avoids overfitting to the noise in the small dataset (which is more problematic than in a large dataset, see below). Your high bias model basically “says less” about the patterns in the data (in the sense that a line of best fit says less than a cubic curve of best fit).

For large data, I would prefer a high variance model. Overfitting is less of a concern than in the small data case: with more data points, there is more opportunity for noise to cancel itself out. The high variance models “says more” about the data, and it should! There’s more data!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the bias of an estimated model tell us about model capacity?

A

The bias of an estimated model tells us about the capacity of the model to capture the relationships in our data, i.e., high bias models tend to be too simple and don’t have the capacity to represent the data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is ensemble learning?

A

Combining many weak learners into a single model. It helps balance bias and variance and avoid overfitting.

The two main types are bagging and boosting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is bagging?

A

When you train multiple instances of the same weak learner on different subsets of the training data, then make predictions by taking an average (regression) or “vote” (classification) from outputs of the ensemble of models.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is boosting?

A

When you train a sequence of the same weak learners so that each learner more heavily weights the training examples that the previous learner got wrong.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is stacking?

A

Partition the training set in two. Train a heterogenous group of weak learners (base models) on the first partition, then train a meta-learner on the outputs of the base models and the second partition, i.e. let the weak learners make predictions from the second partition, feed those to the meta-learner, and train the meta-learner on those.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is regularization?

A

Regularization is the penalization of complexity in models. When models are low bias/high variance or the training set is small, models are subject to overfitting, i.e., capturing noise or patterns specific to the training data that don’t generalize well to other examples.

In short, regularization reduces model variance in order to prevent overfitting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is L1 regularization?

A

L1 regularization (Lasso) adds the absolute values of the coefficients to the loss function, encouraging sparsity by driving some coefficients to exactly zero.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is L2 regularization?

A

L2 regularization (Ridge) adds the squared values of the coefficients to the loss function, penalizing large weights and promoting a more even distribution of weights.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are three general types of regularization?

A

1) Modifying the loss function: L1 or L2 regularization
2) Modify data sampling: Data augmentation, K-Fold Crossvalidation
3) Modify training process: Add noise, dropout

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is data augmention?

A

A regularization method in which we add transformed versions of our training data to the training set, such as rotations, crops, flips, or zoom.

17
Q

What is K-Fold Cross-validation?

A

This is where we divide the data into k subsets, then train on k-1 and test on the remaining 1. We do this on all combinations. Then we evaluate the model the average results across all combinations.