Plotting Cost Function

How do I plot a cost function if there are more than 2 parameters?

1 Like

The cost function is not usually plotted against the parameters or features. What kind of plot were you planning to make?

In many cases, the cost function is plotted against the training iterations, to verify that the cost is really going down through the training process.

1 Like

I wasn’t trying to plot anything. I just saw the lecture on cost function visualization and contour plots, and I had this question in my mind.

1 Like

Ah ok, you’re asking about the contour plot as described in the lectures. In general, there isn’t an easy way to do a contour plot of the cost with more than 2 parameters.

With that said, the contour plot is really to help you gain an intuition on what gradient descent is doing, and isn’t usually too useful in practice.

Okay. Thank you very much for clearing that up.