Difficulty in understanding weighted loss

    m                                                       t

J(θ) = Σw[i] [h(θ)x[i] - y[i] ]**2 = (Xθ - y) w (Xθ - Y)
i=1
t
I think it is wrong it should be equal to w (Xθ - y) (Xθ - Y)

because we can not change the order of matrix in multiplication.

Hey @abhayguptag7, in w (Xθ - y) (Xθ - Y), Here (Xθ - y) has shape of (m,1) and w is (m,m). and (Xθ - y)^T is of shape (1,m)

Now follow yourself, and see which order of matrix multiplication is possible and it should also produce resultant matrix of shape (1*1).

Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section. :blush: