A linear regression formula follows the equation: ˆy=θ0+θ1x1+θ2x2+...+θnxn. Where ˆy is the prediction, and y is the ground truth. The sum of squared errors follows the equation (with m being the number of samples): SSE=Σmi=1(yi-ˆyi)2. When trying to calculate the derivative of the SSE respect to ˆyi I tried this: SSE′=2Σmi=1(yi-ˆyi). I guess there is something wrong in my logic, because of the ˆyi term. Any help would be greatly appreciated.