In the equations for cost function, why the difference is squared and why it is divided by 2?
J = 1/2m sum(f(x) - y^)**2;
Its not very clear why it is squared and why it is divided by 2.
Please see these links:
ok. thanks