1 00:00:00,120 --> 00:00:05,790 Halaal, before going ahead in this session, let's have a quick overview of what we have done in this 2 00:00:05,790 --> 00:00:06,230 project. 3 00:00:06,420 --> 00:00:12,020 So doing lots of things, feature engineering, feature and coding, all these types of things. 4 00:00:12,030 --> 00:00:18,600 In the last session, we have created our amazing machine learning model using cross-validation in which 5 00:00:18,600 --> 00:00:25,290 we have applied this logistic regression algorithm on our data and we have achieved that much accuracy 6 00:00:25,290 --> 00:00:26,100 on our data. 7 00:00:26,310 --> 00:00:31,920 So in this session, what we have to do, we have basically this assignment in which I have to apply 8 00:00:32,190 --> 00:00:36,730 multiple algorithms on our data and we have to check its accuracy as well. 9 00:00:37,080 --> 00:00:44,460 So what our algorithm, you know, whatever, you know what our what our good will execution no bias, 10 00:00:44,460 --> 00:00:52,020 let's say again in random forest decision, tree activist, whatever algorithm, you just implement 11 00:00:52,020 --> 00:00:53,130 it on this data. 12 00:00:53,550 --> 00:00:54,800 So this is exactly your task. 13 00:00:54,810 --> 00:00:58,340 So let me do you all these things in front of you. 14 00:00:58,560 --> 00:01:04,200 So I'm just going to say and if you guys don't know all these algorithms, you can check out my all 15 00:01:04,200 --> 00:01:11,220 the previous videos where I have explained each and every algorithm from scratch, including its mathematical 16 00:01:11,220 --> 00:01:17,220 intuition, because understanding the maths behind algorithm is very important, because whenever you 17 00:01:17,220 --> 00:01:23,790 are going to apply for a green job as a data scientist in any top notch companies, they are not going 18 00:01:23,790 --> 00:01:24,410 to ask who you are. 19 00:01:24,420 --> 00:01:26,940 What is the integration they are going to ask you. 20 00:01:26,940 --> 00:01:32,890 You are telling me how exactly you can achieve that best fit line in linear regression. 21 00:01:33,180 --> 00:01:39,010 So that's why you have to understand mathematics behind each and every algorithm. 22 00:01:39,060 --> 00:01:44,040 So in this session, what we have to do, we are basically going to consider navabi bias, logistic 23 00:01:44,220 --> 00:01:46,140 and random forest. 24 00:01:46,140 --> 00:01:47,220 And this is a tree. 25 00:01:47,490 --> 00:01:53,940 So we are basically going to cover five algorithms and all these five algorithms I have already covered 26 00:01:53,940 --> 00:01:56,250 in my all the previous lectures. 27 00:01:56,610 --> 00:01:59,110 Just go and check out all these things. 28 00:01:59,130 --> 00:02:01,070 So very first I have to import all these things. 29 00:02:01,080 --> 00:02:08,460 I'm going to say from this Escalon module I have something which is exactly my name by I just press 30 00:02:08,460 --> 00:02:08,820 tab. 31 00:02:08,820 --> 00:02:12,600 And from this I have to import my Gorshin and we offer it. 32 00:02:12,600 --> 00:02:13,230 What I have to do. 33 00:02:13,230 --> 00:02:19,680 I'm just going to say from this Escalon, I have to import something on this linear model. 34 00:02:19,680 --> 00:02:21,750 So I'm just going to send in an a school model. 35 00:02:21,750 --> 00:02:26,410 And from this I have to import my logistic regression with exactly this one. 36 00:02:26,730 --> 00:02:30,450 Now, what I have to do from this on, I have to import. 37 00:02:30,450 --> 00:02:31,380 This time I can. 38 00:02:31,380 --> 00:02:34,320 And so I'm going to see neighbors module. 39 00:02:34,320 --> 00:02:38,400 I have something known as my canibus. 40 00:02:38,400 --> 00:02:40,510 You can just press there. 41 00:02:41,040 --> 00:02:47,550 Here you have to import classifier because this is exactly your classification is now what you have 42 00:02:47,550 --> 00:02:55,350 to do from this side could learn you have something known as in Sambal Module and from this in Sambal 43 00:02:55,350 --> 00:03:02,700 module here you have done stuff in Zambia, learning algorithms like Random Forest actually boost and 44 00:03:02,700 --> 00:03:04,050 tons of algorithms. 45 00:03:04,380 --> 00:03:10,620 So I'm going to say I have to import my, let's say, random forest classifier for what I have to do. 46 00:03:10,620 --> 00:03:14,090 Let's say I have to import my let's say this is entry as well. 47 00:03:14,160 --> 00:03:21,630 So I'm just going to say from Sikandar Dautry, I have to import something known as decision tree classifier. 48 00:03:22,110 --> 00:03:24,330 Just aggregate all the stuff lexan. 49 00:03:24,360 --> 00:03:27,120 Just going to define a blank list over there. 50 00:03:27,390 --> 00:03:32,190 And in this blacklist I have to append each and every algorithm. 51 00:03:34,320 --> 00:03:38,190 Then once I have this list, then I'm going to trade on this list. 52 00:03:38,430 --> 00:03:40,440 That is exactly my approach over here. 53 00:03:40,770 --> 00:03:46,740 So I'm just going to say models dot a pen and what I have to open this time. 54 00:03:46,770 --> 00:03:52,200 Let's say I have to have been here in the form of Stupples, where I'm just going to say that if I have 55 00:03:52,200 --> 00:04:00,330 to append this logistic regression and basically this is exactly neme, I have to initialize my regression 56 00:04:00,330 --> 00:04:00,690 as well. 57 00:04:00,720 --> 00:04:07,830 So I'm just going to say logistic regression and just initialize it after what we have to do next. 58 00:04:07,920 --> 00:04:14,970 I'm just going to say I have to abide by another thing which is exactly this time I have to import Mangosteen 59 00:04:15,000 --> 00:04:19,850 and I'm just going to say this is exactly my like Sydney bias. 60 00:04:19,860 --> 00:04:22,680 I'm going to say this is my name bias. 61 00:04:23,040 --> 00:04:29,520 Once I have all these things, then I have to initialize its class as after doing all these things. 62 00:04:29,550 --> 00:04:33,790 Now what we have to do, we have to upend our whole case. 63 00:04:33,850 --> 00:04:38,270 So I'm just going to say third one is exactly my random forests. 64 00:04:38,270 --> 00:04:41,520 So I'm going to say exactly my random forest. 65 00:04:41,520 --> 00:04:43,390 Then I have to initialize its class as well. 66 00:04:43,980 --> 00:04:50,050 So this time I'm just going to say random forest classifier once having all the stuff. 67 00:04:50,080 --> 00:04:56,790 What I have to do, I'm just going to say this time I have to initialize or I have to pass my decision 68 00:04:56,790 --> 00:04:57,000 tree. 69 00:04:57,000 --> 00:05:00,320 So I'm just going to say this is exactly my decision tree. 70 00:05:00,330 --> 00:05:05,430 Then I have to initialize my decision tree as well, which is exactly classifier. 71 00:05:06,750 --> 00:05:13,500 After having all the stuff, you have to upend the algorithm as well, which is exactly OK in it. 72 00:05:13,680 --> 00:05:18,530 So I'm going to say this is my Ghanim and you have to initialize it as well. 73 00:05:18,540 --> 00:05:26,160 So I'm just going to say he niebler classifier and this time if you will pass shift plus that you will 74 00:05:26,160 --> 00:05:29,910 get all the parameters over here, you will get tons of parameters in this class. 75 00:05:30,480 --> 00:05:39,510 So now what you have to do, basically just execute the cell over there and now we have to fetch let's 76 00:05:39,550 --> 00:05:46,650 say let's say we have to print what exactly is my algorithm as well as we have to find all the stats 77 00:05:46,650 --> 00:05:48,300 of this particular algorithm. 78 00:05:48,310 --> 00:05:50,730 It means I just need two things for this. 79 00:05:50,730 --> 00:06:03,000 I'm just going to say for name comma models in model in this model list, once I have this iteration, 80 00:06:03,330 --> 00:06:06,240 after having this iteration, what do we have to do? 81 00:06:06,250 --> 00:06:10,470 Basically, I'm just going to say let's say I have to print my name. 82 00:06:10,470 --> 00:06:17,730 So I'm just going to say just print its name after it or whatever model I have on this. 83 00:06:17,730 --> 00:06:26,470 I'm just going to say just fit my X, underscore Krien and definitely Y underscore Grainne. 84 00:06:26,760 --> 00:06:29,580 Make sure you don't have any case sensitive issues. 85 00:06:29,850 --> 00:06:34,890 So here you will see your X is in top form and your guy is in a small one. 86 00:06:35,160 --> 00:06:39,020 So I'm going to say it is nothing but my X on a screen. 87 00:06:39,180 --> 00:06:42,150 So once you fit what you have to do, you have to do prediction. 88 00:06:42,150 --> 00:06:45,930 So I'm just going to say model dot predict. 89 00:06:46,020 --> 00:06:52,350 And here I have to say on X on the school test, I have to predict once doing prediction, I have to 90 00:06:52,370 --> 00:06:53,280 store somewhere else. 91 00:06:53,280 --> 00:06:59,970 Let's say I'm just going to say it is nothing but my let's say predictions at once having this prediction. 92 00:06:59,990 --> 00:07:05,100 Sorry, what I have to do, let's say I have to create my confused metrics. 93 00:07:05,400 --> 00:07:15,420 So let me just copy this code and let me just based there and let me just initialize my confusing metrics 94 00:07:15,600 --> 00:07:17,010 and hear what I have to say. 95 00:07:17,040 --> 00:07:22,110 I'm just going to say here, I have to say my predictions. 96 00:07:22,110 --> 00:07:23,220 The very first thing. 97 00:07:23,550 --> 00:07:27,840 The second thing is exactly might actually daviss my Y.A. test. 98 00:07:28,170 --> 00:07:31,380 Let's say I have to print this confusing metric. 99 00:07:31,380 --> 00:07:33,820 So I'm just going to print it after it. 100 00:07:33,840 --> 00:07:37,370 What we have to do, we have to print our accuracy as well. 101 00:07:37,380 --> 00:07:40,740 So here I'm going to say accuracy on the score is score. 102 00:07:41,190 --> 00:07:43,860 And the very first parameter is not predictions. 103 00:07:43,860 --> 00:07:48,060 What I have predicted and a second one, what is my actual data? 104 00:07:48,060 --> 00:07:50,060 Which is why NASCO test next. 105 00:07:50,090 --> 00:07:51,540 I have to print this as well. 106 00:07:51,540 --> 00:07:55,500 So I'm going to say just print all these stuff as well. 107 00:07:56,070 --> 00:08:03,200 Let's say after having all this stuff, let's say here I'm going to add my espacio this or that, or 108 00:08:03,210 --> 00:08:08,280 you can say adding my new learning model so that it will be more user friendly. 109 00:08:08,850 --> 00:08:13,380 So after having all this stuff, let me append on Lunine as well. 110 00:08:13,380 --> 00:08:16,850 So I'm going to say just append Newline over here. 111 00:08:16,860 --> 00:08:22,860 So if I'm going to execute this well now, you will see the very first thing is exactly my logistic 112 00:08:22,860 --> 00:08:23,490 regression. 113 00:08:23,490 --> 00:08:28,920 It has that much accuracy and it is exactly it is not my class model. 114 00:08:29,100 --> 00:08:33,150 And if you want to cross validated just about all these different. 115 00:08:33,150 --> 00:08:33,450 Different. 116 00:08:34,020 --> 00:08:40,440 The with respect to neighbors here, you will see this is exactly is confusing metrics, and this is 117 00:08:40,440 --> 00:08:45,520 exactly that accuracy with respect to this my neighbors as well. 118 00:08:45,730 --> 00:08:51,570 After that, you will see with respect to this random forest, you have a damn good accuracy. 119 00:08:51,570 --> 00:08:55,170 You will see your accuracy is 95 percent. 120 00:08:55,290 --> 00:08:59,580 And that's what I have defined in my random pilot's intuition. 121 00:09:00,040 --> 00:09:04,160 Random forest is exactly the best garden of data scientist. 122 00:09:04,650 --> 00:09:06,540 That's why this is exactly that reason. 123 00:09:06,540 --> 00:09:12,930 Whenever you have that much complex data and whenever you have some complex, massive data at the time, 124 00:09:12,930 --> 00:09:17,420 that random forest is going to be super, super over there. 125 00:09:17,790 --> 00:09:22,530 Similarly with the decision tree, it is still executing and it will take a while. 126 00:09:22,530 --> 00:09:23,220 Definitely. 127 00:09:23,220 --> 00:09:30,030 Now you will see with respect to this decision tree, you have somewhere close to your random security. 128 00:09:30,030 --> 00:09:39,210 It means whenever you are going to use it in Sambor learning techniques or new data, almost in 99 percent 129 00:09:39,210 --> 00:09:43,720 of the use cases, you will get your damn good accuracy. 130 00:09:43,980 --> 00:09:50,280 Similarly, with respect to your kenen, you have that definitely you have that much good accuracy. 131 00:09:50,790 --> 00:09:56,880 So you can simply say you are here whenever you have some pretty much complex use cases, your random 132 00:09:56,880 --> 00:10:04,770 forest, your decision tree, your booze, all your Sambell learning approaches are super, super pioneer 133 00:10:05,070 --> 00:10:05,360 there. 134 00:10:05,700 --> 00:10:07,230 So hope you love the session. 135 00:10:07,230 --> 00:10:13,620 And if you guys don't want to know all these algorithms, please go ahead and check out my all the previous 136 00:10:13,620 --> 00:10:20,460 videos in which I have explained each and every ill gotten from scratch, all these algorithms, all 137 00:10:20,460 --> 00:10:27,360 it's mathematical intuition, all these interna how exactly these algorithms works internally, because 138 00:10:27,360 --> 00:10:31,050 you have to make sure you know all these algorithms very well. 139 00:10:31,050 --> 00:10:33,120 So that's all about this project. 140 00:10:33,120 --> 00:10:35,100 Hope you love this project very much. 141 00:10:35,100 --> 00:10:35,860 Thank you. 142 00:10:35,880 --> 00:10:36,800 Have a nice day. 143 00:10:37,200 --> 00:10:37,900 Keep learning. 144 00:10:37,920 --> 00:10:38,850 Keep growing. 145 00:10:39,000 --> 00:10:40,020 Keep motivating.