1 00:00:00,490 --> 00:00:06,630 So in this we do we will learn how to find out the probability of whether a house will be sold within 2 00:00:06,630 --> 00:00:07,740 three months or not. 3 00:00:08,370 --> 00:00:10,300 Given the values of other predictors. 4 00:00:11,720 --> 00:00:16,470 So since we have already 50 model in this deal, I'm not fit very well. 5 00:00:17,190 --> 00:00:22,620 We can use this model to calculate the probabilities using the predict function. 6 00:00:24,780 --> 00:00:27,690 So we will create another variable which will take the probabilities. 7 00:00:28,020 --> 00:00:30,480 It will be called Delimit Dark from. 8 00:00:36,010 --> 00:00:37,350 Is equal to predict 9 00:00:40,090 --> 00:00:46,620 the bracket will write delimit outfit, which is the name of the evil in which we have information of 10 00:00:46,620 --> 00:00:47,760 the model comma. 11 00:00:48,900 --> 00:00:50,390 Type is equal to response. 12 00:01:00,880 --> 00:01:10,420 So you can see on the right we have this new variable delimiter probs, if you want to look at the first 13 00:01:10,420 --> 00:01:17,440 10 values of probabilities, we can IDL MDR probs from one to 10. 14 00:01:21,130 --> 00:01:24,150 So in the bottom, you can see what he first said. 15 00:01:24,410 --> 00:01:30,220 The guy's loaded probability is zero point eight five, which is very close to one, which suggests 16 00:01:30,400 --> 00:01:35,890 that the first holes will be sold within three months. 17 00:01:37,120 --> 00:01:43,340 Second value is telling us that 67 percent chance of House getting sold in the first two months. 18 00:01:45,400 --> 00:01:51,070 The third house is having only a probability of zero point three four, which means that there is only 19 00:01:51,070 --> 00:01:57,370 three percent chance of the House getting sold in the first three months and so on. 20 00:01:57,430 --> 00:01:59,280 So we have these values. 21 00:01:59,290 --> 00:02:00,020 What all leave? 22 00:02:00,070 --> 00:02:01,450 I wonder six obstetrician's. 23 00:02:04,860 --> 00:02:12,330 Now, as I told you, in the end, it's really clear that using a boundary condition, we can assign 24 00:02:12,480 --> 00:02:14,280 classes to these values. 25 00:02:14,490 --> 00:02:20,280 So if I have a boundary condition on point five, I can say that any value, any pro will devalue, 26 00:02:20,280 --> 00:02:21,630 which is greater than point five. 27 00:02:22,080 --> 00:02:23,610 I would classify it as. 28 00:02:23,940 --> 00:02:24,390 Yes. 29 00:02:24,810 --> 00:02:31,470 Meaning that it will be sold in dreamland and wherever the probability values less than point lead. 30 00:02:31,890 --> 00:02:35,220 I will say that no, it will not be sold in three months. 31 00:02:35,490 --> 00:02:40,440 So to create this area of response is containing yes and no. 32 00:02:41,190 --> 00:02:44,850 We will first create an entry called Dehlin. 33 00:02:45,000 --> 00:02:47,220 Not predict is equal to 34 00:02:50,400 --> 00:02:50,910 repeat. 35 00:02:51,060 --> 00:02:51,580 So rep. 36 00:02:52,890 --> 00:03:02,370 Basically I want to first create a array of 506 values in which only values as containing no 37 00:03:05,640 --> 00:03:06,710 comma 506. 38 00:03:07,470 --> 00:03:13,270 It's an array with 506 values and all the values are all on the right. 39 00:03:13,290 --> 00:03:20,090 You can see that we have this every now whenever the probability will lose more than point three. 40 00:03:20,970 --> 00:03:21,790 I will change this. 41 00:03:21,800 --> 00:03:22,130 Nor do. 42 00:03:22,160 --> 00:03:22,540 Yes. 43 00:03:23,130 --> 00:03:24,520 So Gillmore played. 44 00:03:28,580 --> 00:03:29,560 We good record. 45 00:03:29,670 --> 00:03:39,050 We will mention the condition that delimiter probs is greater than point five in all these locations, 46 00:03:40,730 --> 00:03:41,600 in all these locations. 47 00:03:41,630 --> 00:03:42,020 I want. 48 00:03:42,690 --> 00:03:43,130 Yes. 49 00:03:47,550 --> 00:03:50,790 So you can see the first two Aleuts I know, yes. 50 00:03:51,330 --> 00:03:51,930 The third well-used. 51 00:03:52,040 --> 00:03:52,370 No. 52 00:03:53,550 --> 00:03:54,810 Which I also discussed. 53 00:03:56,880 --> 00:04:03,780 Now that we have the predicted classes, for all the 506 observations, we can create the conclusion 54 00:04:03,780 --> 00:04:13,710 matrix confusion matrix will have predicted values on one side and the true values on other to create 55 00:04:13,710 --> 00:04:14,790 confusion matrix. 56 00:04:16,020 --> 00:04:20,040 We will use that table function and the table function. 57 00:04:20,070 --> 00:04:20,730 We have to give 58 00:04:23,690 --> 00:04:24,480 two parameters. 59 00:04:24,630 --> 00:04:30,330 The first parameter is DDL and bread values, which had the predicted values of 60 00:04:34,920 --> 00:04:36,390 whether the house will be sold or not. 61 00:04:37,080 --> 00:04:41,490 And the second is the actual value of whether the house will be sold or not. 62 00:04:41,630 --> 00:04:43,340 Which is D.F. Dollar sold. 63 00:04:47,520 --> 00:04:52,530 So this first parameter, which has the predicted values, will be coming as rules. 64 00:04:52,980 --> 00:04:57,900 And the second parameter will just be if Dollar sold will be coming at two columns. 65 00:04:58,110 --> 00:05:01,500 So let us run this in the bottom. 66 00:05:01,500 --> 00:05:02,040 You can see. 67 00:05:02,220 --> 00:05:02,540 No. 68 00:05:02,550 --> 00:05:03,180 And yes. 69 00:05:03,390 --> 00:05:06,810 Are the predicted values which we have as rules. 70 00:05:07,720 --> 00:05:13,530 Zero and one are the actual values which we have as columns. 71 00:05:14,610 --> 00:05:19,750 The first sin is telling us that one nine four one ninety seven cases. 72 00:05:21,090 --> 00:05:22,620 The actual value is zero. 73 00:05:22,800 --> 00:05:24,190 That is, the house will not be sold. 74 00:05:24,630 --> 00:05:27,180 And we also predicted that it will not be sold. 75 00:05:27,420 --> 00:05:30,480 So we were right in predicting these values. 76 00:05:31,350 --> 00:05:36,350 Similarly, these 149 cases, the actual words also one. 77 00:05:36,570 --> 00:05:37,590 And we also predicted. 78 00:05:37,590 --> 00:05:37,920 Yes. 79 00:05:38,280 --> 00:05:39,370 So that is also correct. 80 00:05:41,000 --> 00:05:44,720 But these are the two values where actual ojito. 81 00:05:44,880 --> 00:05:45,620 And we predicted. 82 00:05:45,620 --> 00:05:45,990 Yes. 83 00:05:46,700 --> 00:05:48,480 And actual odds one. 84 00:05:48,510 --> 00:05:49,530 And we really didn't know. 85 00:05:49,770 --> 00:05:53,070 So this 79 and 81, I need to edit. 86 00:05:55,650 --> 00:06:02,250 So using these few lines of code, we can get the probability of that case belonging to each class, 87 00:06:03,390 --> 00:06:05,210 then using a ball degradation. 88 00:06:05,370 --> 00:06:15,420 We can assign a class to each observation using those predicted values of classes and the actual value 89 00:06:15,420 --> 00:06:15,990 of classes. 90 00:06:16,140 --> 00:06:22,170 We can draw this conclusion matrix to see how well our model is predicting the response where he would.