Can anyone please explain why the summation i = 1 to n is taken care while finding the derivative? For expression without regularization, the summation i = 1 to m appears in derivative equation but summation i = 1 to n is not appearing. I know derivative of w^2 is 2w but why the summation sign for i = 1 to n has disappeared?

The notation here is a little tricky.

The first cost equation (one on top) uses the `w`

variable as a matrix, and the summation there refers to summing up all the params inside the `w`

matrix. Itâ€™s the general equation of cost that applies to all the params (including `w`

).

On the other hand, the derivative equation (down below) is with respect to a single param `w_j`

inside `w`

. The derivative (with respect to `w_j`

) of all the other params in `w`

that is not `w_j`

is 0, and so they sum up to 0. The only term that is not 0 is the derivative of `w_j`

, and so that is the only term you are seeing.

Thank you for explanation. I understand better now.