Linear regression cost function 3d graph

@adam_wilkes, it may be easier to see using a contour map. For example, in this contour map:

Screenshot 2024-08-01 at 6.25.17 PM

you can see that for a given w, the value of b that gives the smallest cost is a different b than the value of b at the overall minimum for the whole function. The shape is still a bowl, but the minimum cost for the part of the bowl you’re slicing through at any given w will not necessarily be at the same b as it is at the global optimum.

You can play around with the optional cost function lab to experiment with the graphs to see how this can vary with different values.

2 Likes