This action might not be possible to undo. Are you sure you want to continue?

cost 2 00:00:05,684 --> 00:00:10,523 function is doing. This video assumes that you're familiar with contour plots. If you 3 00:00:10,523 --> 00:00:15,189 are not familiar with contour plots or contour figures some of the illustrations 4 00:00:15,189 --> 00:00:20,144 in this video may or may not make sense to you but is okay and if you end up skipping 5 00:00:20,144 --> 00:00:24,522 this video or some of it does not quite make sense because you haven't seen 6 00:00:24,522 --> 00:00:29,246 contour plots before. That's okay and you will still understand the rest of this course 7 00:00:29,246 --> 00:00:34,935 without those parts of this. Here's our problem formulation as usual, with the 8 00:00:34,935 --> 00:00:39,882 hypothesis parameters, cost function, and our optimization objective. Unlike 9 00:00:39,882 --> 00:00:45,163 before, unlike the last video, I'm going to keep both of my parameters, theta 10 00:00:45,163 --> 00:00:50,573 zero, and theta one, as we generate our visualizations for the cost function. So, same 11 00:00:50,573 --> 00:00:57,204 as last time, we want to understand the hypothesis H and the cost function J. So, 12 00:00:57,204 --> 00:01:04,167 here's my training set of housing prices and let's make some hypothesis. You know,

But. Now given these value of theta zero and theta one. So. What we 17 00:01:27. then I end up with this hypothesis down here and that 15 00:01:16. So .13 00:01:04.219 --> 00:01:16.150 --> 00:01:37.218 also has a similar sort of bow shape. 23 00:01:58. right. where the axes are labeled theta zero and theta one.340 zero. you know. that the parts we drew had this sort of bow 21 00:01:47. if I set theta 14 00:01:10.511 we want to plot the corresponding. cost function on the right.270 --> 00:01:22.06.190 --> 00:01:27.925 --> 00:01:58.190 corresponds to that straight line.511 --> 00:01:33.925 shaped function. Now. 16 00:01:22.511 you might get a cost function that maybe looks something like this. depending on your training set.404 3-D surface plot.270 zero=50 and theta one=0.814 --> 00:01:42. In other words. It turns out 20 00:01:42.511 --> 00:02:09. it turns out the cost function 22 00:01:52.699 that when we have only one parameter.167 --> 00:01:10.340 --> 00:01:47.814 that look like this as a function of theta one.699 --> 00:01:52. and theta one. when we have two parameters.218 --> 00:02:03. in fact. this is a 24 00:02:03. when we only had theta one.150 did last time was.219 like that one. and so the plot gets a little more complicated. theta 19 00:01:37. drawing plots 18 00:01:33. this is not a particularly good hypothesis. But now we have two parameters. And.

122 vertical axis J(theta zero. Let me show you 30 00:02:36.326 as you vary theta zero and theta one. that's.608 --> 00:03:03. And you can see it sort of has this bow like shape.077 --> 00:03:16.964 --> 00:02:26.471 --> 00:02:46.592 --> 00:03:09.200 height of the surface of the points indicates the value of J of theta zero. So here's an . horizontal axis theta one and 31 00:02:46. So here's the same figure in 3D.475 function J. and if I rotate this plot around. that's the vertical axis. Right. You kinda of a 32 00:02:52. you get different values of the 26 00:02:15.347 --> 00:02:31. I guess they mean the same thing.608 get a sense. theta one. theta one).592 function J looks like. of this bowl shaped surface as that's what the cost 33 00:02:57. instead I'm going to use contour plots. To show you these surfaces.25 00:02:09.077 I'm not actually going to use these sort of 3D surfaces to show you the cost 35 00:03:09.471 of theta one.351 --> 00:02:52. Or what I also call contour 36 00:03:16. the two parameters.122 --> 00:02:57.964 cost function J (theta zero. J 29 00:02:31.475 --> 00:03:24.200 --> 00:02:36. The 28 00:02:26.347 particular point of theta zero.326 --> 00:02:20.748 figures. theta one) and the height of this surface above a 27 00:02:20.404 --> 00:02:15. Now for the purpose of illustration in the rest of this video 34 00:03:03. I hope.351 the same plot in 3D.

602 --> 00:03:43.514 --> 00:03:55.285 --> 00:04:28.602 theta one. for example this. shown on the right.730 --> 00:04:04.668 --> 00:04:24.757 of points that takes on the same value for J(theta zero.285 these concentric ellipses.583 --> 00:03:59. theta one). And imagine a bow shape that sort of grows out of my 48 00:04:24. you know. Where.135 --> 00:03:37.774 zero. so 46 00:04:14.135 example of a contour figure.218 --> 00:04:14. they have the same value 42 00:03:55.774 --> 00:04:10. And what each of these ovals. right. what each of these ellipsis shows is a set 39 00:03:37. So 40 00:03:43.730 for J (theta zero. So that the minimum. theta one) 44 00:04:04.786 screen like this.992 --> 00:04:19. A bow shaped function that's coming out of my screen.748 --> 00:03:31. you'll take that point and that point and that point. imagine if you 45 00:04:10.514 concretely.992 will. theta one axis but those three have the same Value for J (theta zero.668 the bottom of the bow is this point right there. the middle of 47 00:04:19. theta one). right? This middle.37 00:03:24.218 and if you haven't seen contour plots much before think of. these. 41 00:03:50. where the axis are theta zero and 38 00:03:31.757 --> 00:03:50. so that each of these ellipses.583 All three of these points that I just drew in magenta. has the same height . this is the theta 43 00:03:59. Okay.

in fact. with. where it intersects the vertical axis is around 800.283 --> 00:05:37.763 slope of about -0.15 .189 about 800.283 theta one. you know. to that hypothesis. And so you find that.092 and the corresponding.15. [sound] So.275 particular point. 59 00:05:26.092 --> 00:05:17.964 --> 00:05:07. that is. it's really not such a good fit to the data.787 the contour figures is a. let's look at some examples. And so 50 00:04:33. right? And so this is. is way to. this 54 00:05:01. This hypothesis.185 --> 00:04:53. and theta one equals maybe a -0. is maybe a more convenient way to 51 00:04:37.322 --> 00:05:12. right. right.185 visualize my function J. h(x). And the minimum with the bow. and this is 57 00:05:17. theta zero equals maybe 53 00:04:53.859 data. Is a value that's out here that's you know pretty far from the minimum right .345 above my screen.763 --> 00:05:26.531 cost. theta zero is 56 00:05:12.345 --> 00:04:37. Over here.859 --> 00:05:32. And so this point.189 --> 00:05:21. theta one 55 00:05:07.964 about 800. Now this line is really not such a good fit to the 58 00:05:21. is right down there. right.786 --> 00:04:33.275 --> 00:05:01. right. I have a 52 00:04:45. with these values of theta zero.787 --> 00:04:45.322 point in red corresponds to one set of pair values of theta zero. it's 60 00:05:32.49 00:04:28.

plotted as the height of the J function at that point.791 --> 00:06:44.886 --> 00:06:52.421 --> 00:06:38. So that's the hypothesis. that is.986 --> 00:06:07. and 70 00:06:32.047 --> 00:06:20.387 one and so my theta zero value.047 one.901 it's pretty far this is a pretty high cost because this is just not that good a fit 62 00:05:42. Let's take theta zero equals 67 00:06:14.531 --> 00:05:42.61 00:05:37.247 to the data.489 --> 00:05:57. at this value 72 00:06:44. you know.886 Let's look at just a couple of examples.161 --> 00:06:32. Let's look at some more examples.986 better so here right that's my point that those are my parameters theta zero theta 65 00:05:57.161 hypothesis. And this pair of parameters corresponds to that 68 00:06:20. corresponds to flat line. we end up with this hypothesis.600 that cost is. you know.489 hypothesis that's you know still not a great fit for the data but may be slightly 64 00:05:52. you know. h(x) 73 . Right? That's bout 360 and my value for theta 66 00:06:07. Now here's a different 63 00:05:47. And this hypothesis again has some cost.063 360 theta one equals zero. h(x) equals 360 plus zero 69 00:06:26. Is equal to zero.387 --> 00:06:14. 71 00:06:38. and at that value of theta one. So.421 times x.231 of theta zero. Here's one more. let's break it out.901 --> 00:05:47.063 --> 00:06:26.247 --> 00:05:52.

337 --> 00:07:18. So with these figures I hope that gives you a better 82 00:07:37. of.259 --> 00:07:32. And so the sum of squares errors is sum of squares distances between 79 00:07:23. this is not quite at the minimum.548 right? Of all of these errors.450 --> 00:07:08. Now of course what we really 85 . where. to the data. but it's pretty close to the minimum.039 pretty close.869 --> 00:07:47.486 --> 00:07:13. This is pretty close to the minimum even though 81 00:07:32.337 zero. that's a sum of square distances.599 --> 00:07:03. Really. one of them has value.869 understanding of what values of the cost function J.450 actually not quite at the minimum.983 that are closer to the minimum of this cost function J. how they are and how that 83 00:07:41. We 77 00:07:13. theta 76 00:07:08.096 --> 00:07:41.039 --> 00:07:28. but it's 78 00:07:18. training samples and my hypothesis.548 --> 00:07:37.231 --> 00:06:58. 80 00:07:28. this is 74 00:06:58.004 --> 00:07:23. Last example. And this is.00:06:52.324 corresponds to different hypothesis and so as how better hypotheses may corresponds to points 84 00:07:47.486 is not such a bad fit to the.259 my. Which.324 --> 00:07:52. and is actually further away from the minimum.004 get a particular h(x). not a great fit to the data. as in for a particular value for theta one. for a particular value.096 it's not quite the minimum. So this 75 00:07:03.599 and again.

00:07:52.664 this becomes much harder to visualize. you know. to plot out this point. that 90 00:08:15.619 --> 00:08:02.566 --> 00:08:10.916 --> 00:08:42. we'll see later in 92 00:08:23.938 when we look at more complicated examples. and 93 00:08:28. it turns out. we'll see it later.906 --> 00:08:28. and then try to manually read off the 89 00:08:10.566 cost function J. you know. what we don't wanna do is to.091 --> 00:08:33. right.664 --> 00:08:37.906 more parameters. that.697 write software.914 --> 00:08:47. a efficient piece of software for 86 00:07:57. in fact. right? And what we. theta one that minimizes this function and 95 00:08:37.729 to find the value of theta zero. that minimizes the 87 00:08:02.426 --> 00:08:19. how to 88 00:08:06.938 --> 00:08:23. we'll see in a few.983 --> 00:07:57.218 --> 00:08:06.697 --> 00:08:15. we'll have high dimensional figures with 91 00:08:19.218 automatically finding The value of theta zero and theta one. what we want is to have software 94 00:08:33.263 numbers. And. examples where this figure.619 want is an efficient algorithm. And so.914 in the next video we start to talk about an algorithm for automatically finding 96 00:08:42. that this is not a good way to do it.091 this course.600 that value of theta zero and theta one that minimizes the cost function J. . cannot really be plotted.

- lab_5
- Lab_4
- Lab_1
- Hidraul Cilind Sem
- LV2_Zadatak 3
- Semina Avion
- lv5
- SiS Vezbe 5 - Laplaceova Transformacija
- m933301e
- Zadaci-AKTUATORI
- Mis Predavanje Modeliranje-6
- 4-redovi
- INFORMATICS 2007
- ELEK_ZR_2003 test
- DSU Tutorijal 5
- Laboratorijska Vjezba 6 Iz MIS 2007-2008
- demo1
- Domaci 3 - uradjen
- Blabla
- 1 - 2 - What is Machine Learning- (7 min).txt
- NiksaMaslovic_DigitalniUlaziIzlazi
- CasMatrice6
- IUS-Graduate Application Form
- Nastavni Plan I Godina ETR

Sign up to vote on this title

UsefulNot useful- Matlab challenge at high school level
- OR quiz
- Kalman Filter Presentation
- Maths
- tnpsc GROUP-I-1998
- lec11
- The Comparative Study of the Aspects of Perceived Stress among the Internet Bank Customers on their Devotion in the Private and State Banks
- Lecture 7
- MIT15_053S13_lec1
- Hedging RUT With TF
- 1) Mathematical Language.pdf
- Linear Programming
- Old Research Process
- 1010 Optimization Project
- Chapter 1
- CK 12 Chemistry Second Edition
- What is Hypothesis
- Drawing Conclusions From Data. Computational Journalism week 11
- Hypothesis Testing
- Complete Glossary
- Biology Lab Report
- Summary Research Methods
- Analytical Thinking Training (1)
- IA Criteria
- Business Research Methodology
- Null Hypothesis Banning
- 188
- Growth Relativity Hypothesis
- Pyramid Principle
- Chappuis Halder Cie Options Pricer Documentation
- 2 - 4 - Cost Function - Intuition II (9 Min)