# #13 Machine Learning Specialization [Course 1, Week 1, Lesson 3] | Summary and Q&A

27.8K views
December 1, 2022
by
DeepLearningAI
#13 Machine Learning Specialization [Course 1, Week 1, Lesson 3]

## TL;DR

This video explores visualizations of the cost function J of w and B in linear regression, using both 3D surface plots and contour plots.

## Key Insights

• 🇨🇷 The cost function in linear regression can be visualized using both 3D surface plots and contour plots.
• 🇨🇷 Visualizing the cost function helps in understanding the relationship between the model function and the cost.
• 😥 Contour plots show points with the same cost function value, providing insight into the different combinations of parameters.
• 😥 The minimum point on the contour plot corresponds to the optimal parameters for the model.
• 👋 Visualizing the cost function aids in finding the best parameters for the linear regression model.
• 🇨🇷 3D surface plots and contour plots provide a more intuitive understanding of the cost function compared to numerical values alone.
• 🇨🇷 Contour plots offer a 2D representation of the cost function and make it easier to analyze.

## Transcript

in the last video you saw one visualization of the cost function J of w or jfwb let's look at some further richer visualizations so you can get an even better intuition about what the cost function is doing here is what we've seen so far there's the model the model's parameters wmb the cost function J of w and B as well as the go of linear regressi... Read More

### Q: What is the purpose of visualizing the cost function in linear regression?

Visualizing the cost function helps to understand how the model function relates to the cost function and aids in finding the optimal parameters for the model.

### Q: How does the cost function change when there are two parameters in the model?

When there are two parameters, the cost function becomes more complex and resembles a 3D surface plot, with varying values for different combinations of the parameters.

### Q: What does each point on the 3D surface plot represent?

Each point on the 3D surface plot represents a specific choice of parameters (W and B) for the model, and the height of the surface at that point represents the value of the cost function.

### Q: How is the cost function visualized using contour plots?

Contour plots provide a 2D visualization of the cost function by taking horizontal slices of the 3D surface. Each contour or oval represents points with the same height or value of the cost function.

## Summary & Key Takeaways

• The video discusses the model, parameters, and cost function in linear regression.

• It shows how the cost function J of w and B can be visualized using 3D surface plots.

• The video also introduces contour plots as an alternative visualization method for the cost function.