1 00:00:01,150 --> 00:00:07,360 In this lecture, we are going to create a neural network model, but we will not use the Gatehouse 2 00:00:07,390 --> 00:00:07,870 package. 3 00:00:09,670 --> 00:00:12,160 We will instead use the new Rolex package. 4 00:00:13,690 --> 00:00:16,450 All of us is more widely used today. 5 00:00:17,260 --> 00:00:21,390 You should also know what this package, because it is a very simple code. 6 00:00:22,510 --> 00:00:25,840 Good for this is actually simpler than Nick Gordon gave us. 7 00:00:27,080 --> 00:00:33,470 Secondly, discord looks more like the court for other congressional machine learning techniques, a 8 00:00:33,620 --> 00:00:41,930 not so seasoned art user may prefer this court for implementing neural network for similar problems. 9 00:00:43,950 --> 00:00:44,640 So let's start. 10 00:00:47,250 --> 00:00:53,790 As usual, we start by installing and activating the new package called neural net. 11 00:00:55,700 --> 00:00:57,440 Here we installed the package. 12 00:01:04,010 --> 00:01:05,900 Then we only require a mind. 13 00:01:09,240 --> 00:01:10,500 To load this package. 14 00:01:13,060 --> 00:01:17,320 You can see on the right hand side that this package has our take on it. 15 00:01:17,500 --> 00:01:19,380 That is this package is now active. 16 00:01:21,400 --> 00:01:25,480 Next here, I'm creating a smaller bee, does it? 17 00:01:28,050 --> 00:01:29,480 Which I'm calling D.F.. 18 00:01:31,080 --> 00:01:32,620 So the FSD does. 19 00:01:33,030 --> 00:01:39,950 It has three columns as representing the number of hours a student has studied before an exam. 20 00:01:41,990 --> 00:01:49,070 Next is Mock Test, which is representing students schooled in a more test or practice test. 21 00:01:50,810 --> 00:01:57,410 And last is Bost, representing Vedette, the student past the main exam on North. 22 00:01:59,570 --> 00:02:01,280 So this is the data frame. 23 00:02:01,580 --> 00:02:02,780 It has three columns. 24 00:02:02,990 --> 00:02:06,980 And here are the values that I input in these three columns. 25 00:02:10,370 --> 00:02:12,060 Now, listen, all these command. 26 00:02:17,430 --> 00:02:19,790 And let's have a look at the D.F.. 27 00:02:21,290 --> 00:02:22,880 The data that we have created. 28 00:02:24,750 --> 00:02:25,920 So you're going to look at this. 29 00:02:26,040 --> 00:02:29,070 It has three features and six observations. 30 00:02:29,990 --> 00:02:31,740 Mock test and bust. 31 00:02:34,910 --> 00:02:39,590 Next, we train a model using the neural net function. 32 00:02:40,910 --> 00:02:47,150 If you've seen linear regression in art, you will notice that this has a very similar structure to 33 00:02:47,150 --> 00:02:47,930 that function. 34 00:02:49,850 --> 00:02:52,310 The first barometer of dysfunction. 35 00:02:54,030 --> 00:02:59,580 Is telling the model about output variable and the predicted variables. 36 00:03:00,620 --> 00:03:04,260 So the variable on the left hand side of this listenable. 37 00:03:05,760 --> 00:03:11,520 Is considered as the variable to be predicted and all the variables to the date. 38 00:03:13,760 --> 00:03:15,110 Deep predicted variables. 39 00:03:16,970 --> 00:03:20,720 These variables belong to the data named D.F.. 40 00:03:22,470 --> 00:03:30,950 Hidden is equal to three comma two means that we want to hit and let's first hit and left will have 41 00:03:30,950 --> 00:03:34,700 three neurons, and the second, the left will have two neurons. 42 00:03:36,750 --> 00:03:42,990 If you specify only one number here, say if you write it down is equal to three. 43 00:03:43,320 --> 00:03:47,130 That means you will have only one had to live with three neurons. 44 00:03:49,140 --> 00:03:53,490 Next, barometer's activation function, which we set as logistic. 45 00:03:55,710 --> 00:04:02,160 And lastly, lenient output is equal to falls means that we are doing classification. 46 00:04:03,240 --> 00:04:11,220 If we put this as true, that would mean that we are doing regression and the design of this neural 47 00:04:11,220 --> 00:04:13,550 network function will be stored in the variable called. 48 00:04:13,710 --> 00:04:15,780 And then let's run this. 49 00:04:18,050 --> 00:04:21,760 Now, the next come on is my favorite thing about this method. 50 00:04:23,200 --> 00:04:24,590 Let's just run it and see. 51 00:04:27,720 --> 00:04:31,160 This gives a very clean visual representation of our model. 52 00:04:33,210 --> 00:04:40,290 These numbers here are the weight and these numbers in blue are the biases. 53 00:04:42,010 --> 00:04:46,760 So you can clearly figure out which neuron is doing what from this graph. 54 00:04:49,330 --> 00:04:51,500 Here you can also see that and be first in alert. 55 00:04:51,630 --> 00:04:55,230 We have three neurons and in the second in the lead, we have two neurons. 56 00:04:56,270 --> 00:04:58,220 If we go and change this. 57 00:04:59,330 --> 00:05:00,120 He didn't, but I mean. 58 00:05:01,030 --> 00:05:03,880 Then we'll have a different neural network structure here. 59 00:05:07,200 --> 00:05:10,620 Now to show you how to find this said predictions. 60 00:05:11,190 --> 00:05:14,760 I have created another dataset called Test. 61 00:05:15,780 --> 00:05:17,580 It is this this dataset. 62 00:05:18,690 --> 00:05:26,550 It has to close the yards and be more pissed, the Yards has these three values and demarked best has 63 00:05:26,670 --> 00:05:27,620 these three values. 64 00:05:29,630 --> 00:05:33,160 Let's run this and look at the desert. 65 00:05:35,150 --> 00:05:39,610 So basically we are saying that we have data for every student. 66 00:05:40,670 --> 00:05:46,190 The first student has studied for 20 years and had earlier scored 80 in the practice test. 67 00:05:47,270 --> 00:05:54,560 The second student has again studied for 20 years, but scored only 13 marks in the practice test. 68 00:05:55,310 --> 00:06:00,020 And the total, they studied for 30 years and scored 20 in the practice test. 69 00:06:00,860 --> 00:06:05,540 Now we want to predict which of these students will pass and which of them will be. 70 00:06:07,980 --> 00:06:13,260 To predict whether these students will pass or fail, we use the compute function. 71 00:06:14,450 --> 00:06:20,750 In this, we give our train model as the first parameter that is stored in in in. 72 00:06:21,920 --> 00:06:27,200 And best as the second barometer, which is these tests said that we have created. 73 00:06:29,830 --> 00:06:35,140 The output of this function will be stored in a variable called predict next on this. 74 00:06:38,710 --> 00:06:42,690 So you can see a new variable called Predicted Created, which is a list of two. 75 00:06:44,810 --> 00:06:51,110 If you want to look at the predicted probabilities, we can run this, come on now, does predict dollar 76 00:06:51,190 --> 00:06:51,910 net daughter. 77 00:06:54,710 --> 00:06:57,680 Now you can make out just by looking at diplomatese. 78 00:06:58,760 --> 00:07:02,840 That which student is likely to pass and which is likely to fail. 79 00:07:04,980 --> 00:07:09,940 However, if you want to assign a glass, you can use, it fails. 80 00:07:10,950 --> 00:07:14,310 That is, if the probability is greater, ten point five. 81 00:07:14,970 --> 00:07:17,190 Then we will see that this student has passed. 82 00:07:17,280 --> 00:07:18,570 So we will assign one. 83 00:07:19,650 --> 00:07:24,540 And if it is less, then point you, there is a student history and will assign Zillo. 84 00:07:25,390 --> 00:07:27,510 So let's run this code also. 85 00:07:32,690 --> 00:07:39,530 You can see that we are predicting that first two students will pass and a third student is likely to 86 00:07:39,530 --> 00:07:40,250 fail the exam. 87 00:07:44,190 --> 00:07:50,790 Well, that's all we just made a complete neural network model in a few minutes. 88 00:07:51,060 --> 00:07:54,480 And you'd like to make predictions, as you can see. 89 00:07:54,570 --> 00:08:00,810 This library is simple, but it is not as flexible as guitars and antiflu. 90 00:08:02,290 --> 00:08:04,810 So for simple mortals, you can use it. 91 00:08:05,890 --> 00:08:06,460 That's all. 92 00:08:06,730 --> 00:08:07,120 Thank you.