What is the difference between Newton-Raphson and gradient descent as solvers for logistic regression?

Quick Overview

Asks how Newton-Raphson and gradient descent differ when fitting a logistic regression model. Tests knowledge of first- and second-order updates, per-step cost, convergence speed, feature scaling, the IRLS connection and quasi-Newton methods such as L-BFGS.

What is the difference between Newton-Raphson and gradient descent as solvers for logistic regression?

Role: Data Scientist

Category: Machine Learning

Difficulty: medium

Interview Round: Other

What is the difference between Newton-Raphson and gradient descent as solvers for logistic regression? Cover how each one updates the weights and when you would choose one over the other. ```hint What each step uses Gradient descent uses only the first derivative of the log-loss. What extra information does Newton's method use, and what does it cost to compute for d features? ``` ```hint Think about scale Consider one feature measured in dollars and another that is a 0/1 flag. How does that mismatch affect each method? ``` ### What a Strong Answer Covers - The update rule for each method and what information each one uses - Per-iteration cost and memory as the number of rows and features grows - Convergence speed, and sensitivity to the learning rate and to feature scaling - How Newton's method for logistic regression relates to iteratively reweighted least squares - The practical options in between, such as L-BFGS and stochastic methods, and when to pick each ### Follow-up Questions - Write the gradient and Hessian of the logistic log-loss in matrix form. - What happens to both solvers when the classes are perfectly separable? - You have 10 million sparse text features. Which solver do you choose, and why? - Why can Newton's method diverge from a poor starting point, and how do implementations guard against it?

Overview: Asks how Newton-Raphson and gradient descent differ when fitting a logistic regression model. Tests knowledge of first- and second-order updates, per-step cost, convergence speed, feature scaling, the IRLS connection and quasi-Newton methods such as L-BFGS.

General logo
General
Nov 25, 2026
mediumData ScientistOtherMachine Learning
0
0

What is the difference between Newton-Raphson and gradient descent as solvers for logistic regression? Cover how each one updates the weights and when you would choose one over the other.

What a Strong Answer Covers Guidance

  • The update rule for each method and what information each one uses
  • Per-iteration cost and memory as the number of rows and features grows
  • Convergence speed, and sensitivity to the learning rate and to feature scaling
  • How Newton's method for logistic regression relates to iteratively reweighted least squares
  • The practical options in between, such as L-BFGS and stochastic methods, and when to pick each

Follow-up Questions Guidance

  • Write the gradient and Hessian of the logistic log-loss in matrix form.
  • What happens to both solvers when the classes are perfectly separable?
  • You have 10 million sparse text features. Which solver do you choose, and why?
  • Why can Newton's method diverge from a poor starting point, and how do implementations guard against it?