1 00:00:00,500 --> 00:00:01,266 So let's do this. 2 00:00:01,266 --> 00:00:04,533 Let's be efficient and copy this line, because we will only need to change 3 00:00:05,033 --> 00:00:05,866 a few things. 4 00:00:05,866 --> 00:00:07,300 But you're going to see that this time. 5 00:00:07,300 --> 00:00:09,866 It's not going to be that simple as here. 6 00:00:09,866 --> 00:00:12,000 It's going to be simple, but not that simple. 7 00:00:12,000 --> 00:00:14,400 We just need to add several arguments. And why is that? 8 00:00:14,400 --> 00:00:15,733 The reason is very logic. 9 00:00:15,733 --> 00:00:18,766 It's because since our polynomial regression model 10 00:00:18,800 --> 00:00:23,166 learns the correlations on this data set containing the level column 11 00:00:23,166 --> 00:00:26,800 and also the level two, level three and level four columns. 12 00:00:27,033 --> 00:00:30,133 Well, when we create this new data frame containing 13 00:00:30,133 --> 00:00:33,400 only the 6.5 level observation. 14 00:00:33,400 --> 00:00:37,500 Well, since our polynomial regressor is based upon these four columns here 15 00:00:37,500 --> 00:00:39,633 level level two, level three and level four, 16 00:00:39,633 --> 00:00:40,700 then that means that 17 00:00:40,700 --> 00:00:44,366 in this new observation cell that we created for our level 6.5, 18 00:00:44,666 --> 00:00:47,500 we not only need to input the level, 19 00:00:47,500 --> 00:00:50,566 but also the level to the level three and the level four. 20 00:00:50,900 --> 00:00:52,400 And that's what's going to change here. 21 00:00:52,400 --> 00:00:56,866 That's the only thing that is a little less simple than what we did before. 22 00:00:57,000 --> 00:00:59,400 But it's still very simple because as you can see, 23 00:00:59,400 --> 00:01:02,600 it will be very quick and easy to add this values. 24 00:01:03,166 --> 00:01:05,133 So let's do this. Let's not forget to change. 25 00:01:05,133 --> 00:01:08,100 Of course the regressor here, it's not linear anymore. 26 00:01:08,100 --> 00:01:11,366 It's poly rag because poly rag is the name 27 00:01:11,366 --> 00:01:15,600 we gave to our polynomial regression regressor in this formula right here 28 00:01:16,633 --> 00:01:17,466 okay. 29 00:01:17,466 --> 00:01:20,266 And so now as I just explained we just need to add here 30 00:01:20,266 --> 00:01:23,366 the polynomial features of our levels. 31 00:01:23,666 --> 00:01:27,633 So that means that we need to add level two right here. 32 00:01:28,266 --> 00:01:30,500 And don't worry we don't need to compute it ourselves. 33 00:01:30,500 --> 00:01:33,500 We just need to add here 6.5 34 00:01:34,100 --> 00:01:35,233 squared. 35 00:01:35,233 --> 00:01:38,200 And that will do it because you know level two contains 36 00:01:38,200 --> 00:01:41,200 the square values of the values in the level column. 37 00:01:41,766 --> 00:01:45,900 And that's why here we add level two equals 6.5 squared. 38 00:01:46,400 --> 00:01:48,100 And same for the other levels. 39 00:01:48,100 --> 00:01:51,966 We actually made fourth degree polynomial regression model. 40 00:01:51,966 --> 00:01:53,966 So we need to add here four levels. 41 00:01:53,966 --> 00:01:59,900 And so I'm adding here level three equals 6.5 at the power of three. 42 00:02:00,233 --> 00:02:05,900 And our last level level four equals 6.5 at the power four. 43 00:02:06,300 --> 00:02:07,100 And that's it. 44 00:02:07,100 --> 00:02:09,266 It was only this little less simple thing to do. 45 00:02:09,266 --> 00:02:10,600 But now it's ready. 46 00:02:10,600 --> 00:02:11,666 So let's check it out. 47 00:02:11,666 --> 00:02:15,800 And actually we're about to find out the final verdict of the heart of the 48 00:02:15,800 --> 00:02:20,100 negotiation, which is the most accurate predicted salary 49 00:02:20,100 --> 00:02:23,433 that this future potential employee had in its previous company. 50 00:02:23,866 --> 00:02:26,400 So let's find out. I'm going to select all this 51 00:02:27,466 --> 00:02:28,600 and press Command and Control. 52 00:02:28,600 --> 00:02:30,633 Press enter to execute. 53 00:02:30,633 --> 00:02:31,466 Here we go. 54 00:02:31,466 --> 00:02:32,900 So what is the final value. 55 00:02:32,900 --> 00:02:35,933 It's $158,000. 56 00:02:35,933 --> 00:02:38,400 So very close to what the employee said. 57 00:02:38,400 --> 00:02:40,033 He said 160 K. 58 00:02:40,033 --> 00:02:42,866 And we predicted 158 K. 59 00:02:42,866 --> 00:02:46,100 So that's awesome news because not only we can proceed 60 00:02:46,100 --> 00:02:50,466 to the right direction of our negotiation, but also we can now be relieved 61 00:02:50,466 --> 00:02:54,333 that this new future potential employee is very honest. 62 00:02:54,333 --> 00:02:58,300 And that's one of the best quality to have in life, including professional life. 63 00:02:58,800 --> 00:03:01,200 So verdict is it truth or bluff? 64 00:03:01,200 --> 00:03:03,933 Well, the final verdict is truth. 65 00:03:03,933 --> 00:03:07,933 So we are ending this tutorial as well as this section about polynomial regression. 66 00:03:07,933 --> 00:03:08,966 On a good note. 67 00:03:08,966 --> 00:03:10,166 So happy ending. 68 00:03:10,166 --> 00:03:13,500 Not only the verdict is truth, but also we can be proud 69 00:03:13,500 --> 00:03:16,700 of having built your very first non-linear regression model. 70 00:03:16,800 --> 00:03:20,500 So congratulations again and you're going to see that in the next sections 71 00:03:20,500 --> 00:03:23,500 we will be introduced to some new non-linear regression models. 72 00:03:23,700 --> 00:03:25,700 And some of them are fascinating. 73 00:03:25,700 --> 00:03:28,700 So you'll see I look forward to seeing you in the next section. 74 00:03:28,900 --> 00:03:30,700 I'll just add the final tutorial here. 75 00:03:30,700 --> 00:03:32,566 But that's not to build any more model, it's 76 00:03:32,566 --> 00:03:34,666 just that we're going to make a regression template, 77 00:03:34,666 --> 00:03:36,433 you know, to build a lot more efficiently. 78 00:03:36,433 --> 00:03:39,833 The next regression models, you will have of course, the code templates. 79 00:03:39,833 --> 00:03:42,033 And you'll see how it will be very useful. 80 00:03:42,033 --> 00:03:44,033 So I look forward to seeing you in the next section. 81 00:03:44,033 --> 00:03:45,333 Congratulations again. 82 00:03:45,333 --> 00:03:47,133 And until then, enjoy machine learning.