1
00:00:01,080 --> 00:00:07,600
Now let's learn how to create a logistic regression with multiple independent variables and by.

2
00:00:09,030 --> 00:00:14,850
We will use the same template and the same code which we use for creating logistic regression with a

3
00:00:14,850 --> 00:00:19,140
single variable will just change our X and Y variables.

4
00:00:19,980 --> 00:00:22,920
And we will use this same port.

5
00:00:23,670 --> 00:00:29,880
Remember, if you are reopening your python, you need to import all the libraries that we imported

6
00:00:29,940 --> 00:00:30,480
earlier.

7
00:00:32,850 --> 00:00:41,670
And you just have to give values of your X and Y to create this model similar to last time.

8
00:00:42,020 --> 00:00:46,610
We'll use two libraries for space, a skillern and then start smaller.

9
00:00:49,380 --> 00:00:56,940
So this thing, our X, which is independent variables, should contain all the variables except sold

10
00:00:56,940 --> 00:00:59,340
variable from our data frame.

11
00:01:02,340 --> 00:01:08,760
Since we do not want this sorry variable, we can remove this from our data frame.

12
00:01:08,790 --> 00:01:11,070
So we'll be at door lock.

13
00:01:16,470 --> 00:01:18,540
And then we will put the colon.

14
00:01:18,990 --> 00:01:22,570
Since we want all rules, we are just put in colon.

15
00:01:22,620 --> 00:01:23,730
This means all rows.

16
00:01:24,630 --> 00:01:30,040
Then we'll put comma the argument before this comma.

17
00:01:30,150 --> 00:01:31,560
As four rolls.

18
00:01:31,860 --> 00:01:35,970
So if you mention any specific rule, it will only fit those rules.

19
00:01:36,060 --> 00:01:39,420
But since we want all the rules, we have put colon.

20
00:01:40,080 --> 00:01:47,130
And after this comma, we need to mention our column names since we need all the columns except the

21
00:01:47,130 --> 00:01:49,830
sorted volume will write B.F. dot columns.

22
00:01:56,060 --> 00:02:00,090
Not according to solid.

23
00:02:07,210 --> 00:02:09,890
We'll run this over X really believes that, Eddie.

24
00:02:12,920 --> 00:02:20,110
We need on these solid variable from our data frame as dependent variable rate like we to be.

25
00:02:20,750 --> 00:02:21,910
And then a squared record.

26
00:02:22,070 --> 00:02:26,080
I will mention the column name that is sort.

27
00:02:32,660 --> 00:02:40,310
If you want to look at the data, you can take head of X and Y, we will follow the same step as we

28
00:02:40,310 --> 00:02:48,080
did for logistic regression model with single variable, with first clear classifier object of logistic

29
00:02:48,080 --> 00:02:52,610
regression and then fade X and Y into that object.

30
00:02:53,300 --> 00:02:56,570
So does the same code as last time.

31
00:02:56,810 --> 00:02:58,080
So we will get a clear trend.

32
00:02:58,220 --> 00:02:58,610
This.

33
00:03:01,800 --> 00:03:06,870
We have fitted our model to look at the coefficient value of this model.

34
00:03:08,220 --> 00:03:12,330
We have to call attribute of this object, which is quiff underscored

35
00:03:15,220 --> 00:03:17,280
since our model is allowed.

36
00:03:17,400 --> 00:03:21,850
We will write C11, score a la dot quiff, underscore this.

37
00:03:23,070 --> 00:03:24,140
These are the coefficient.

38
00:03:25,320 --> 00:03:29,400
So the first one is between, the second one is Bitauto and so on.

39
00:03:31,770 --> 00:03:37,440
So the coefficient of your prize variable is minus zero point two five.

40
00:03:38,880 --> 00:03:42,120
And then our next variable was that I said a.D.A.

41
00:03:42,240 --> 00:03:53,160
So the coefficient of, let's say the area is minus zero point zero zero eight six and so on to get

42
00:03:53,160 --> 00:03:56,010
the value off and be done or which is intercept.

43
00:03:56,240 --> 00:04:00,480
We'll write CLV, underscore a la dot intercept.

44
00:04:03,130 --> 00:04:05,170
You can see this is the value of Bedazzler.

45
00:04:06,070 --> 00:04:11,070
Now we have values of all the B does, but does it all be done up to be happy?

46
00:04:14,230 --> 00:04:19,630
We can use these values to get the equation of what logic function.

47
00:04:23,200 --> 00:04:29,380
Using this bit of values, you can predict the probabilities and we will use those probabilities to

48
00:04:29,380 --> 00:04:32,440
predict why variable and coming radios.

49
00:04:36,280 --> 00:04:45,680
This is all you for logistic regression model and a Skillern on let's move on to a sex model.

50
00:04:47,050 --> 00:04:53,830
As I mentioned earlier, for sex model, we need to add consent and deliver X by default.

51
00:04:54,040 --> 00:04:56,980
The intercept value is zero and it sets model.

52
00:04:57,130 --> 00:04:59,650
That is B to zero, equal to zero.

53
00:05:01,840 --> 00:05:07,840
But to add consent, we will create X, underscore Korn's variable.

54
00:05:10,690 --> 00:05:15,850
Remember to import the sex model liabilities before executing this.

55
00:05:15,850 --> 00:05:16,180
Come on.

56
00:05:18,790 --> 00:05:20,380
Now let's forget this model.

57
00:05:24,030 --> 00:05:30,660
We will use the same code that we use for logistic regression with single word even

58
00:05:33,650 --> 00:05:35,760
and to get the summary of this model.

59
00:05:35,900 --> 00:05:36,360
Well, right.

60
00:05:36,540 --> 00:05:37,890
Logic, not somebody.

61
00:05:42,210 --> 00:05:49,100
You can see in the bottom table we have all the variables as the rules and we have their coefficient

62
00:05:49,520 --> 00:05:50,610
in the first column.

63
00:05:51,000 --> 00:05:58,500
And then we have other values, such as the standard error, the value and p value for each of these

64
00:05:58,500 --> 00:05:59,130
variables.

65
00:06:00,090 --> 00:06:01,440
This is how we run the model.

66
00:06:01,600 --> 00:06:04,260
We discuss the result and upcoming weirdo's.
