QUIZ
Linear models
9 questions on Linear models, from 5 lessons. Pick an answer in your head, then open it.
On the roadmap for: ML Engineering, Data Science.
Question 1 of 9
What does ordinary least squares minimise?
- A. The sum of squared residuals
- B. The number of wrong predictions
- C. The sum of absolute residuals
- D. The largest single residual
View answer
✓ A. The sum of squared residuals
OLS picks weights that make Σ(yᵢ − ŷᵢ)² as small as possible.
Lesson: Linear Regression
Question 2 of 9
Why is ordinary least squares sensitive to outliers?
- A. It needs normalised features, which outliers distort
- B. It ignores large errors and fits the bulk of the data instead of the outliers
- C. Squaring makes one large residual count more than many small ones
- D. It fits the median, which outliers can move a lot
View answer
✓ C. Squaring makes one large residual count more than many small ones
An error of 10 costs 100, as much as a hundred errors of 1, so outliers pull the line towards them.
Lesson: Linear Regression
Question 3 of 9
What is the key difference between Lasso and Ridge?
- A. Lasso can set weights exactly to zero; Ridge only shrinks them
- B. Lasso penalises squared weights; Ridge penalises absolute weights
- C. Ridge sets weights to zero; Lasso only shrinks them
- D. Lasso is for classification; Ridge is for regression
View answer
✓ A. Lasso can set weights exactly to zero; Ridge only shrinks them
Lasso's L1 penalty produces sparse models (feature selection); Ridge's L2 penalty keeps every feature but smaller.
Lesson: Regularized Linear Models
Question 4 of 9
You have many correlated features and want some feature selection without dropping whole correlated groups at random. Which model fits best?
- A. Lasso alone
- B. Ridge alone
- C. Elastic Net
- D. Plain OLS, which keeps every feature
View answer
✓ C. Elastic Net
Elastic Net mixes L1 (sparsity) with L2 (keeps correlated features together, stabilising the choice).
Lesson: Regularized Linear Models
Question 5 of 9
Why is logistic regression called regression when it's used for classification?
- A. It fits a linear model to the log-odds of the positive class
- B. It is trained with squared error on 0/1 labels, just like linear regression
- C. It was named by mistake and the name stuck
- D. It predicts a continuous score that is then rounded
View answer
✓ A. It fits a linear model to the log-odds of the positive class
The linear part predicts log-odds; the sigmoid turns them into a probability, and a threshold makes the class.
Lesson: Logistic Regression
Question 6 of 9
What does log-loss punish most?
- A. Predictions close to 0.5 for any class
- B. Inputs with very large feature values
- C. Correct predictions with low confidence
- D. Confident predictions that are wrong
View answer
✓ D. Confident predictions that are wrong
Loss is −log p for the true class; as p → 0 for the true class, the loss grows without limit.
Lesson: Logistic Regression
Question 7 of 9
In logistic regression, a feature's coefficient is β = 0.7. What happens when that feature rises by one unit?
- A. The probability is multiplied by 0.7
- B. The log-loss falls by 0.7
- C. The odds are multiplied by e^0.7 ≈ 2
- D. The probability rises by 0.7
View answer
✓ C. The odds are multiplied by e^0.7 ≈ 2
Each unit adds β to the log-odds, which multiplies the odds by e^β.
Lesson: Logistic Regression
Question 8 of 9
What does softmax regression do with K classes?
- A. Trains K separate yes/no models, then picks whichever one is the most confident
- B. Fits squared error to one-hot labels for each class
- C. Picks the class with the largest input feature value
- D. Turns K scores into probabilities summing to 1, trained with cross-entropy
View answer
✓ D. Turns K scores into probabilities summing to 1, trained with cross-entropy
It generalises logistic regression to many classes, and it's the last layer of every LLM, over the vocabulary.
Lesson: Softmax Regression
Question 9 of 9
You need to predict the number of insurance claims per customer (0, 1, 2…). Which model fits best?
- A. k-means clustering of customers by claims
- B. Poisson regression, a GLM with a log link
- C. Logistic regression on whether any claim is made
- D. Linear regression on the claim counts
View answer
✓ B. Poisson regression, a GLM with a log link
Counts are non-negative and skewed. A Poisson GLM models the log of the expected count linearly.
Lesson: Generalised Linear Models