# Difference between Gradient Descent and Normal Equation in Linear Regression

Hi I am new to Linear Regression. I want to know

what is the difference b/w Gradient Descent and Mean Square Error in Linear Regression using machine learning?

And

When to use Gradient Descent and Mean Square Error in Linear Regression using machine learning? Or

When to use which algorithm in Linear Regression.?

Can anyone explain.?

• Mean Square Error is a loss function not an algorithm. You don't need to choose between MSE and Gradient Descent. Did you perhaps mean to name a different algorithm (e.g. the Normal Equation)? – Neil Slater Oct 4 '18 at 7:56

To train a model, two processes have to be followed. From the predicted output, the error has to be calculated w.r.t the real output. Once the error is calculated, the weights of the model has to be changed accordingly.

Mean square error is a way of calculating the error. Depending upon the type of output, the error calculation differs. There are absolute errors, cross-entropy errors, etc. The cost function and error function are almost the same.

• :- Hi Can you please tell me when to use Gradient Descent in Linear Regression..? Because their might be different algorithm .? Why only Gradient Descent.? Is their any specific reason for using Gradient Descent.? – Sanjiv Oct 4 '18 at 11:11