Home › Claude › aifoundations › linear_regression_and_supervised_learning › The least-squares cost function in CS229 linear-…
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.
Related questions
The resulting per-example log-likelihood is, up to constantsWhy is STOCHASTIC gradient descent often preferred over BATCH gradient descent on very larClosed-form normal equations require XᵀX to beLogistic regression uses which hypothesis function?The PROBABILISTIC justification for the least-squares cost assumes the noise ε⁽ⁱ⁾ in y⁽ⁱ⁾ Why is the least-squares optimisation for LINEAR regression guaranteed to converge to the The design matrix X for n training examples with d features (plus intercept) has shapeThe closed-form 'normal equations' solution for least-squares linear regression is