 So one of the things that we can do now that we're representing polynomials inside of numPy is let's just say I had this arbitrary graph going on here And I happen to have some data points that just happen to be sort of plotted and I'll kind of speed through this Let's just say I happen to have tons of data points that sort of fit this visualization going on here now Visually, we can see that there's a nice little slope going on and it's pretty Visual for us to interpret but the idea is how can I represent this or? Represent the line that this function is well presenting and you know again We can see that it's coming in is not perfect I'm not an artist at all But you can see that you know I should see this form of a curve and there should technically be some type of Value and polynomial function associated with this curve. So how could I go about? Representing that let's say for example again We pull up our spider and I'll just arbitrarily take the code that we've done and make some quick changes. So We'll say that this is going to 20 really quickly 9 10 11 12 13 14 15 16 17 18 19 20 Now I'm only picking 20 because one it hits the entire screen But that should give us some idea of our model now again. That's just a linear number of 1 to 20 and Specifically that's almost really acting as sort of our Worry sort of as our x axis going on here as you can see sort of as this X sort of increments upward the values are changing on the y axis and that's specifically what we would want to represent So I'm going to call that my x axis and then I'll come in and I'll do sort of the same thing just with a slight twist to my y numbers so my Numbers I'll go from 1 to 10 and then now what I'm going to do for sort of the back half of this So I'm actually going to go downward so starting from 10 going to 1 so 10 9 8 7 6 5 4 3 2 1 Okay, again, if you think about it, that's just me saying we go to 1 2 3 4 5 6 7 8 10 9 8 7 6 5 4 3 2 1 Okay, fair enough. That's what my x and y axes are doing now what numpy happens to have For us is it will do curve fitting now specifically instead of it working off of our poly one dimension What I'll say is I'll call this curve mp dot Poly and instead of it going poly 1d fit poly fit is going to expect specifically three parameters an X list a an X range a y range and then a Degree of your polynomial so in our case we happen to have an X we happen to have in a Y Now if we think about it my curve that I'm kind of demonstrating is just a simple curve nothing terribly crazy It's not doing any crazy loops or you know anything just a simple X squared curve so in our case that would mean that it is a Second-degree polynomial line now again if I just come in and I'll just show that part for now if I came in print Curve none not in all caps if I print this out What we're seeing is specifically in a numpy array that is presenting a polynomial function for our fitted model So in this case what we're seeing here is roughly speaking negative 0.09 four times X squared plus 1.9 times X to the first power plus negative 1.7 times X to the 0th power or times one and in fact I can actually Do that I can show show that as a more visually Accurate polynomial function by turning it into a poly 1d function, so again in our case in p dot poly 1d Let's see that would be our curve our one-dimensional curve not curve and The same kind of thing. I'll just come in and instead of printing curve. I'll print poly and So as you can see sort of what's going on here is now. I've got that same value times X to the second power That same 1.9 times X to the first powers just not showing it In our case not plus because it was a negative, but minus 1.7 times X to the 0th power Okay, so where do we start to see something we start to see some ways that we can interpret or in Interpret some of the data and what other values might happen so in our case if say for example Let me find out now instead of you know, I have 1 to 20, right? But what if I had 10.5? All right, well Polly 10.5 again We can treat this as if it was an actual function And so if I run this what I should see is roughly speaking That if I passed it 10.5 Interestingly enough it's not going all the way to 10 Because even though our curve hit 10 in our curve didn't fit to 10. It will kind of interpret Oh, well, that's roughly speaking at the 8.6 range same kind of thing if I passed it say for example a I don't know a one Polly one I'll get roughly speaking a 0.14 so again if you think about that that 10.5 very high at sort of almost the peak of our Value, but the one at the very bottom and I could bet you if I came in and finally I passed it something like I don't know 19.5 just to kind of show this off again. I should imagine that 19.5 well that 10 was very high and one was very low if we're fitting that curve 19.5 should also be very low and in our way you notice it happens to be very low as well And it's a little more than the one but as you can see it's producing a value of 1.01