Visualization of J function

I am wondering about the visualisation of J function , since we have more than one function that have the same J …then how should I know which one exactly is the best ? Because you know they are all straight line equations with different slopes and Y intercepts .
Thank you in advance

Perhaps you are confused about what J represents.

J is the cost value. It is a measure of how well the model fits the data.

The model itself is (in the simplest form) a straight line equation f(w,b) = w * x + b.

Thanks for responding ,
Yes I know this very well , but my point is , when I want to change my parameters so the model can fit the data , I can still have more than one equation with the same J (error) for the given parameters ….so how do I decide which one of them to take ?
Thank you in advance.Much appreciated

No, that’s not the case. There is only one set of w and b values that will minimize the cost. You don’t pick the equation, just the weights.

And you don’t pick the cost function either, there is only one cost function for each type of regression. For example, linear regression always uses the “sum of the squares of the errors” cost function.


See here ? The upper right photo shows three sets of b,w values with the same J value (look at the heights in the image below).

My statements refer to the optimized value after the model is trained. It refers to the singular point labeled “minimum”.

That curve does not show different equations. It shows different degrees of convergence as the weight values are optimized.

2 Likes

Hi,
You can imagine that in a 2-dimensional space, the graph of a quadratic function has only one minimum point. Similarly, for a picture of a mountain, you can understand that the mountain has only one highest point, which corresponds to the w and b we need to find