Start learning →

The least-squares cost function in CS229 linear-regression notes is

AJ(θ) = Σ y⁽ⁱ⁾
BJ(θ) = Σ log(h(x⁽ⁱ⁾))
CJ(θ) = Σ |h(x⁽ⁱ⁾) − y⁽ⁱ⁾|
DJ(θ) = ½ Σ (h(x⁽ⁱ⁾) − y⁽ⁱ⁾)²
Answer & Solution
Correct answer: D. J(θ) = ½ Σ (h(x⁽ⁱ⁾) − y⁽ⁱ⁾)²
Least-squares cost J(θ) = ½ Σᵢ (h_θ(x⁽ⁱ⁾) − y⁽ⁱ⁾)². The ½ disappears under differentiation, making the gradient cleaner.
Practise this question with Quill — Claude →

Keep practising Linear Regression and Supervised Learning

Browse all Linear Regression and Supervised Learning questions for Claude, or explore more Aifoundations topics.

Start a Linear Regression and Supervised Learning lesson →
Related questions