AIML Rounds

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.

  1. Question 1 of 9

    What does ordinary least squares minimise?

    1. A. The sum of squared residuals
    2. B. The number of wrong predictions
    3. C. The sum of absolute residuals
    4. 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

  2. Question 2 of 9

    Why is ordinary least squares sensitive to outliers?

    1. A. It needs normalised features, which outliers distort
    2. B. It ignores large errors and fits the bulk of the data instead of the outliers
    3. C. Squaring makes one large residual count more than many small ones
    4. 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

  3. Question 3 of 9

    What is the key difference between Lasso and Ridge?

    1. A. Lasso can set weights exactly to zero; Ridge only shrinks them
    2. B. Lasso penalises squared weights; Ridge penalises absolute weights
    3. C. Ridge sets weights to zero; Lasso only shrinks them
    4. 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

  4. 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?

    1. A. Lasso alone
    2. B. Ridge alone
    3. C. Elastic Net
    4. 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

  5. Question 5 of 9

    Why is logistic regression called regression when it's used for classification?

    1. A. It fits a linear model to the log-odds of the positive class
    2. B. It is trained with squared error on 0/1 labels, just like linear regression
    3. C. It was named by mistake and the name stuck
    4. 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

  6. Question 6 of 9

    What does log-loss punish most?

    1. A. Predictions close to 0.5 for any class
    2. B. Inputs with very large feature values
    3. C. Correct predictions with low confidence
    4. 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

  7. Question 7 of 9

    In logistic regression, a feature's coefficient is β = 0.7. What happens when that feature rises by one unit?

    1. A. The probability is multiplied by 0.7
    2. B. The log-loss falls by 0.7
    3. C. The odds are multiplied by e^0.7 ≈ 2
    4. 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

  8. Question 8 of 9

    What does softmax regression do with K classes?

    1. A. Trains K separate yes/no models, then picks whichever one is the most confident
    2. B. Fits squared error to one-hot labels for each class
    3. C. Picks the class with the largest input feature value
    4. 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

  9. Question 9 of 9

    You need to predict the number of insurance claims per customer (0, 1, 2…). Which model fits best?

    1. A. k-means clustering of customers by claims
    2. B. Poisson regression, a GLM with a log link
    3. C. Logistic regression on whether any claim is made
    4. 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