🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Logistic Regression from Scratch: all 10 questions

Quiz: Logistic Regression from Scratch · Question 5 of 10

In logistic regression trained with log loss, what is the gradient for the weight w?

In logistic regression trained with log loss, what is the gradient for the weight w?

  1. A.mean(p × y)
  2. B.mean((p − y) × x)
  3. C.mean((y − p) ÷ x)
  4. D.sum(p) − sum(y)
Answer & explanation

Correct answer: mean((p − y) × x)

It has the same shape as the linear regression gradient, with the sigmoid output p in place of the line.

Can you get the rest right without peeking?

Take the timed Quiz: Logistic Regression from Scratch quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →