I knew this cold but still fumbled the notation a bit under pressure.
Start by defining the per-example loss using the negative log-likelihood for binary cross-entropy, then sum or average over n examples to get the total loss. Optionally, add an L2 regularization term to the objective and explain its purpose. Keep the notation clean and consistent, and mention that logistic regression outputs probabilities via the sigmoid function.
Pro tip: Emphasize that the loss is convex, which guarantees convergence to the global minimum, and mention that L2 regularization helps prevent overfitting—this shows you understand both theory and practical trade-offs.
State that logistic regression predicts probability p = σ(w·x + b), where σ is the sigmoid function. This sets the context for the loss.
For a single example (x, y) with y ∈ {0,1}, the loss is L(y, p) = -[y log(p) + (1-y) log(1-p)]. Explain that this is the negative log-likelihood.
Sum the per-example losses: J(w,b) = -Σ_{i=1}^n [y_i log(p_i) + (1-y_i) log(1-p_i)]. Optionally, mention that averaging (dividing by n) is common for optimization.
Include the L2 penalty term: J_reg(w,b) = J(w,b) + λ ||w||^2 (or λ/2 ||w||^2). Explain that λ controls regularization strength and helps prevent overfitting.
Mention that the loss is convex and differentiable, and that regularization trades off bias and variance. This shows deeper understanding.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.