← 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?
- A.mean(p × y)
- B.mean((p − y) × x)
- C.mean((y − p) ÷ x)
- 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 →