if you have data that' kind of all over the place and has lot of varianceyou can go crazy and create line that just like goes up and down to try to fit that data as closely as it canbut in fact that doesn' represent the intrinsic relationship of that data it doesn' do good job of predicting new values so always start by just visualizing your data and think about how complicated does the curve really needs to be now you can use -squared to measure how good your fit isbut rememberthat' just measuring how well this curve fits your training data--that isthe data that you're using to actually make your predictions based off of it doesn' measure your ability to predict accurately going forward laterwe'll talk about some techniques for preventing overfitting called train/testbut for now you're just going to have to eyeball it to make sure that you're not overfitting and throwing more degrees at function than you need to this will make more sense when we explore an exampleso let' do that next implementing polynomial regression using numpy fortunatelynumpy has qpmzgju function that makes it super easy to play with this and experiment with different resultsso let' go take look time for fun with polynomial regression really do think it' funby the way it' kind of cool seeing all that high school math actually coming into some practical application go ahead and open the pmzopnjbm fhsfttjpojqzoc and let' have some fun let' create new relationship between our page speedsand our purchase amount fake dataand this time we're going to create more complex relationship that' not linear we're going to take the page speed and make it some function of the division of page speed for the purchase amountnbuqmpumjcjomjof gspnqzmbcjnqpsu oqsboepntffe qbhf qffet oqsboepnopsnbm qvsdibtf"npvou oqsboepnopsnbm qbhf qffet tdbuufs qbhf qffetqvsdibtf"npvou