Describe the Error
Hey team, I was going through the "Cost Function Intuition" lab and noticed that the formula and values displayed on the first interactive plot (Minimize Cost) are misleading. The text on the graph says cost = (1/m)*(1250 + 5000) = 3125.
The issue is that it uses 1/m instead of 1/2m, and the squared errors have already been pre-divided by 2 (displaying 1250 and 5000 instead of the actual squared errors of 2500 and 10000). This hides the squaring operation from the student and contradicts the standard $J(w,b)$ formula taught in the videos.
To Reproduce
Steps to reproduce the behavior:
- Go to the 'Cost Function Intuition' lab.
- Scroll down to the first interactive plot titled 'Minimize Cost'
- .Look at the purple text annotations at the bottom of the left 'Housing Prices' plot.
- The text incorrectly displays the multiplier as 1/m and shows pre-divided squared errors.
Expected behavior
The text and annotations should map perfectly to the standard cost function formula taught in the lectures: $J(w,b) = \frac{1}{2m} \sum (f(x) - y)^2$. The "cost for point" values should display the actual squared errors (2500 and 10000), and the final calculation string should explicitly show the correct fraction, like: cost = (1/2m) * (2500 + 10000) = 3125.
Screenshots

Desktop (please complete the following information):
OS: macOS
Browser: Chrome
Version: Version 144.0.7559.133 (Official Build) (arm64)
Smartphone (please complete the following information):
Additional context
I just wanted to flag it because it could be confusing for beginners trying to manually verify the math from the lectures, since the squaring step is practically invisible and the fraction is stated incorrectly.
Describe the Error$J(w,b)$ formula taught in the videos.
Hey team, I was going through the "Cost Function Intuition" lab and noticed that the formula and values displayed on the first interactive plot (Minimize Cost) are misleading. The text on the graph says cost = (1/m)*(1250 + 5000) = 3125.
The issue is that it uses 1/m instead of 1/2m, and the squared errors have already been pre-divided by 2 (displaying 1250 and 5000 instead of the actual squared errors of 2500 and 10000). This hides the squaring operation from the student and contradicts the standard
To Reproduce
Steps to reproduce the behavior:
Expected behavior$J(w,b) = \frac{1}{2m} \sum (f(x) - y)^2$ . The "cost for point" values should display the actual squared errors (2500 and 10000), and the final calculation string should explicitly show the correct fraction, like: cost = (1/2m) * (2500 + 10000) = 3125.
The text and annotations should map perfectly to the standard cost function formula taught in the lectures:
Screenshots

Desktop (please complete the following information):
OS: macOS
Browser: Chrome
Version: Version 144.0.7559.133 (Official Build) (arm64)
Smartphone (please complete the following information):
Additional context
I just wanted to flag it because it could be confusing for beginners trying to manually verify the math from the lectures, since the squaring step is practically invisible and the fraction is stated incorrectly.