Lesson deck

The learning problem: generalization, bias-variance and regularization flashcards

Reviewing needs JavaScript. You can read every card in the list below.

Loading your cards...

Back to the lesson10 cards in this deck

Read all 10 cards as a list
  1. Front
    What is empirical risk, and what is it a proxy for?
    Back
    The average loss on the training set. It stands in for expected risk, the average loss on unseen data from the same source, which we cannot measure directly. Learning works only if the first tracks the second.
  2. Front
    Parameter versus hyperparameter?
    Back
    Parameters (weights) are learned from training data by the optimizer. Hyperparameters (learning rate, tree depth, lambda) are set by you and chosen with validation data.
  3. Front
    What is the job of each split: train, validation, test?
    Back
    Train fits the parameters. Validation chooses hyperparameters and models. Test is used once at the end for an unbiased estimate. Train learns, validation chooses, test judges.
  4. Front
    Name three data leaks and the fix for each.
    Back
    Scaler or imputer fitted before splitting: fit inside the training fold (a Pipeline). Rows of one entity on both sides: group k-fold. Random split on time-ordered data: forward-chaining split.
  5. Front
    Write the squared-error decomposition and say what each term means.
    Back
    Expected error = bias squared + variance + irreducible noise. Bias is systematic error from a too-simple model, variance is sensitivity to the training sample, noise is label noise no model can remove.
  6. Front
    Train error 2%, validation error 25%. Diagnosis and fixes?
    Back
    High variance (overfitting). After ruling out leakage: more data, regularization, a simpler model, early stopping, augmentation, or bagging. A bigger model makes it worse.
  7. Front
    What do learning curves show, and when does more data not help?
    Back
    Train and validation error against training-set size. Both plateau high and close together means bias: more data will not help, add capacity or features. A large gap that narrows with data means variance: more data helps.
  8. Front
    Why does L1 give exact zeros but L2 does not?
    Back
    The L1 gradient has constant size, so it can push a small weight all the way to zero (the solution is a soft threshold). The L2 gradient shrinks in proportion to the weight, so it approaches zero but does not arrive. Geometrically the L1 diamond has corners on the axes.
  9. Front
    What does raising lambda do to training error and to validation error?
    Back
    Training error never falls (it rises or stays flat), because the penalty makes the fit to the training data worse. Validation error usually falls first as variance drops, then rises once the model underfits. Choose lambda at the validation minimum.
  10. Front
    Why standardize features before an L1 or L2 penalty?
    Back
    The penalty adds up weight sizes, and a weight's size depends on the feature's units. Without scaling, the penalty treats metres and millimetres differently. Fit the scaler on training data only.