0% found this document useful (0 votes)
45 views2 pages

7 Cost Function Intuition I

The document discusses the intuition behind a cost function in machine learning. It explains that the cost function measures the average squared vertical distance between data points and the fitted line, with the goal of minimizing this distance. It provides a visual example where the cost is 0 when the line fits all points perfectly, and the cost increases as the line deviates further from the data points. The overall goal is to find the parameters that result in the lowest possible cost.

Uploaded by

anon_277569233
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views2 pages

7 Cost Function Intuition I

The document discusses the intuition behind a cost function in machine learning. It explains that the cost function measures the average squared vertical distance between data points and the fitted line, with the goal of minimizing this distance. It provides a visual example where the cost is 0 when the line fits all points perfectly, and the cost increases as the line deviates further from the data points. The overall goal is to find the parameters that result in the lowest possible cost.

Uploaded by

anon_277569233
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

8/2/2018 Coursera | Online Courses From Top Universities.

Join for Free | Coursera

Back to Week 1 Lessons Prev Next

Cost Function - Intuition I


If we try to think of it in visual terms, our training data set is scattered on the x-y plane. We are trying to make a
straight line (de ned by ) which passes through these scattered data points.

Our objective is to get the best possible line. The best possible line will be such so that the average squared vertical
distances of the scattered points from the line will be the least. Ideally, the line should pass through all the points
of our training data set. In such a case, the value of will be 0. The following example shows the ideal
situation where we have a cost function of 0.

When , we get a slope of 1 which goes through every single data point in our model. Conversely, when
, we see the vertical distance from our t to the data points increase.

This increases our cost function to 0.58. Plotting several other points yields to the following graph:

Thus as a goal, we should try to minimize the cost function. In this case, is our global minimum.

 Complete

  

https://www.coursera.org/learn/machine-learning/supplement/u3qF5/cost-function-intuition-i 1/2
8/2/2018 Coursera | Online Courses From Top Universities. Join for Free | Coursera

https://www.coursera.org/learn/machine-learning/supplement/u3qF5/cost-function-intuition-i 2/2

You might also like