Can anyone help me about cost function in linear regression. As from the below plot we have input values and predicted value there is no Y value, help
Topic cost-function linear-regression machine-learning
Category Data Science
Topic cost-function linear-regression machine-learning
Category Data Science
I’m going to solve a different problem so that you still have to do something on your own for your homework, but this should give you a template for solving your assignment.
$$ (X_1,Y_1)=(1,1)\\ (X_2,Y_2)=(3,5) $$
If $h_{\theta}(x)=\theta_0+\theta_1x+\theta_2x^2$, let’s calculate the cost $J(\theta_0,\theta_1,\theta_2)=\sum_i \big(h(x^{(i)}-y^{(i)} \big)^2$when $\theta_0=\theta_1=\theta_2=2$.
$$ J(2,2,2) = \bigg(\big(2+2(1)+2(1^2)\big)-1\bigg)^2 + \bigg(\big( 2+2(3)+2(3^2) \big) -5\bigg)^2 \\ = 25+441\\=466 $$
Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.