KatInterview

Regularization Penalties, Regression Basics, and Classification Metrics

Machine LearningModel answer
MediumModel answerMachine Learningregularizationclassification-metricsregression

Last updated

Define precision and recall, compare L0/L1/L2/L∞ penalties, state linear regression assumptions, and contrast linear with logistic regression.

Predictive Modeling Fundamentals

You are reviewing a set of candidate models for a binary classification task alongside a continuous prediction task. Before choosing a regularizer or evaluating results, your team wants to align on the core concepts.

Answer each part below. Where relevant, include formulas, trade-offs, and concrete use cases.

Part 1 — Evaluation metrics Define precision and recall. Explain the trade-off between them and describe at least two real scenarios where each metric should take priority.

Part 2 — Regularization Compare L0, L1 (Lasso), L2 (Ridge), and L∞ regularization. For each: write the penalty term, describe the geometric intuition, state whether the resulting optimization is convex, and give a practical use case.

Part 3 — Linear regression assumptions List the key assumptions underlying ordinary least squares (OLS) linear regression. Note which are required for unbiasedness, which for the Gauss-Markov result, and which only for exact inference.

Part 4 — Linear vs. logistic regression Write the model formula and loss function for each. Explain why logistic regression has no closed-form solution while linear regression does, and interpret what a fitted coefficient means in each case.

Hints

Hint 1

For precision vs. recall, anchor your reasoning in the relative cost of false positives versus false negatives rather than just the class imbalance ratio.

Hint 2

The geometric shape of each penalty's constraint region (diamond, sphere, hypercube) explains why L1 produces exact zeros and L2 does not — think about where the loss contours first touch each shape.

Hint 3

When comparing the two regression formulas, focus on the link function and the assumed noise distribution — those two differences drive everything else, including whether a closed-form solution exists.