Cost Function (Method I)
For calculating the cost in linear regression, typically we use Sum of Squared Error method(SSE)
The goal is to minimize J(θ) and figure out θ values corresponding to the minimum cost. There are several optimization algorithms used to achieve this.
J(θ)=12m∑mi=1(h(x(i))−y(i))2
The goal is to minimize J(θ) and figure out θ values corresponding to the minimum cost. There are several optimization algorithms used to achieve this.