WEBVTT

00:01.250 --> 00:04.640
In this session, we will discuss about the based algorithm.

00:06.100 --> 00:12.220
So first of all, before getting into my base, we need to understand a few concepts of probability.

00:13.160 --> 00:19.100
So let us discuss about this particular data here, we have different fruits.

00:20.330 --> 00:27.980
And out of these frauds, if we need to find out the probability of getting apples or oranges or bananas,

00:28.250 --> 00:32.060
we will be having to find out the ratio of these.

00:32.240 --> 00:33.320
So how would we do that?

00:33.620 --> 00:36.160
To find out the probability of apples?

00:36.500 --> 00:43.300
The probability of apples will be the number of apples divided by the total number of fruit.

00:44.540 --> 00:48.080
Similarly, the probability of oranges would be.

00:49.460 --> 00:58.100
The number of oranges divided by the total number of fruit and the probability of getting a banana would

00:58.100 --> 01:02.450
be the number of banana divided by the total number of fruit.

01:03.900 --> 01:11.460
Now, by this condition, if they want to find out the probability of getting E, then the probability

01:11.460 --> 01:18.650
of getting it will be the number, the models of E divided by the models of the universe.

01:18.660 --> 01:23.910
That is the number of a divided by the number of elements in the entire universe.

01:25.130 --> 01:31.490
Now, if you want to find out the probability of getting the then the probability of getting the will

01:31.490 --> 01:38.050
be the number of elements and in divide divided by the number of all the elements present in the universe.

01:38.960 --> 01:42.590
So this is the statement for both of these.

01:43.230 --> 01:45.000
Now, let us get further.

01:45.800 --> 01:55.810
Now let us see that A and B actually intersect at a B, and we have some common elements named as Ebby.

01:56.540 --> 02:04.730
Then what will be the probability of getting Aebi the probability of getting a will again be the problem,

02:04.880 --> 02:13.100
the amount of the number of elements of a B divided by the number of elements in the universe.

02:14.830 --> 02:23.470
Now, let us assume let us see that what is the probability of getting A, given that B is already two?

02:24.400 --> 02:31.150
Now, if you want to find out the probability of a given vs already through, then the probability will

02:31.150 --> 02:40.670
be the area which is both a B divided by the universe b, B, because these already through.

02:40.900 --> 02:44.230
So we know that the universe for this is the.

02:46.750 --> 02:55.390
So here, because the universe is V, so the probability of A given B is already through will be A B

02:55.540 --> 02:57.100
divided by B.

02:58.010 --> 03:09.860
Now, we can also write it up on the as a given universe and be given universe, so probability of A

03:09.860 --> 03:12.200
given B will be equal to.

03:13.360 --> 03:21.820
A B divided by universe, I'm B divided by Univers now this storm can also be written as.

03:23.760 --> 03:25.500
Probability of a.

03:26.830 --> 03:34.720
And similarly be given, Univers can also be written as probability of being.

03:35.560 --> 03:44.320
From this, we can derive that probability of A given B is equal to probability of any given problem

03:44.740 --> 03:46.960
divided by the probability of B.

03:48.590 --> 03:53.120
Now, can we derive the probability of being given a using this?

03:54.770 --> 04:00.990
So the probability of A, given B is probability of Ebbie divided by probability of me.

04:01.490 --> 04:04.370
So just swapping all the envy's.

04:04.550 --> 04:05.610
So what do we get?

04:05.810 --> 04:13.340
We get probability of be given e- equal to probability of A B divided by the probability of A.

04:14.980 --> 04:24.040
Now, let us try to replace the probability of EBE here with the probability of evacuation, which we

04:24.040 --> 04:25.070
get from this one.

04:25.810 --> 04:26.780
So what do we get?

04:27.190 --> 04:36.700
We will get a probability of Ebbe and probability of V is equal to probability of being in probability

04:36.700 --> 04:36.970
of.

04:37.840 --> 04:46.800
A not as probability of a given be in the probability of B, equal to probability of being given, E

04:46.990 --> 04:48.670
in the probability of A.

04:49.710 --> 04:59.400
Hence, we can see the probability of A given B is equal to probability of be given E in the probability

04:59.400 --> 05:02.820
of E divided by probability of B.

05:05.330 --> 05:14.420
So we are treating probability of a given me is equal to probability of be given a Endou probability

05:14.420 --> 05:16.250
of E that is.

05:17.360 --> 05:23.270
What we are trying to find out, divided by the probability of V, which is given here.

05:24.050 --> 05:25.420
So how do we do that?

05:27.480 --> 05:27.930
Now.

05:29.010 --> 05:36.480
What are the values here, probability of a human being is equal to probability of a intersection B

05:36.870 --> 05:38.460
A born probability of B.

05:39.430 --> 05:45.580
That is equal to probability of the probability of being given a divided by probability of the.

05:46.470 --> 05:55.650
Here, the probability of a probability of a probability of these probability of the probability of

05:55.650 --> 05:57.060
a human being is.

05:58.550 --> 05:59.870
Probability of a given.

06:00.470 --> 06:07.910
This means that probability of being given A and B of A intersection B, this is the probability of

06:07.910 --> 06:09.620
both A and B occurring.

06:13.250 --> 06:19.340
Now, let us try to relate this to the problem which we have.

06:20.510 --> 06:27.020
Now, the statement which we have just created, this is called the Nijhuis Equation.

06:29.190 --> 06:37.020
Now, let us have a look at this and try to relate it to the type of problem that we have now, usually

06:37.290 --> 06:39.510
let us take the loan data example.

06:40.320 --> 06:50.440
Now we want to find out the probability of a person defaulting on a loan given certain conditions.

06:50.490 --> 06:51.700
What are those conditions?

06:51.960 --> 06:55.860
Those conditions are different values of those features.

06:56.160 --> 06:58.130
That is different attributes.

06:58.440 --> 07:07.230
So we have to find out if someone will default on the loan or not based on what is the salary of the

07:07.230 --> 07:09.670
person, how many children he has.

07:09.870 --> 07:11.570
What are the number of dependents?

07:11.730 --> 07:13.140
What is the FICO range?

07:13.260 --> 07:15.510
So based on all of these criteria?

07:16.830 --> 07:23.080
We want to find out the probability of it, so now you can relate to this, right?

07:23.340 --> 07:31.650
This is actually the value by which we want to predict and B, are the X values, that is the input

07:31.650 --> 07:36.810
values that are features or attributes or the independent variables.

07:37.780 --> 07:46.720
Now thinking about independent variables, so the property of independent variables is that we are trying

07:46.720 --> 07:54.700
to find the intersection of all these, when all of these things are true, then all of these intersection

07:54.700 --> 08:01.810
is true that this we want to find out the probability of E for different combinations of these one be

08:01.840 --> 08:02.980
to be three before.

08:04.100 --> 08:06.930
Now, what are these be1 B to be three, four?

08:07.370 --> 08:14.090
So these will be if the someone has the number of children as one, if someone has a number of dependents

08:14.720 --> 08:17.480
do and then what is the salary of the person?

08:17.510 --> 08:23.150
So these good ideas together will become a condition.

08:23.480 --> 08:27.200
And that condition has been depicted by this intersection.

08:29.000 --> 08:37.760
Now we will have the same thing and all the places that is probability of a given BE1 be to be investigated.

08:38.980 --> 08:45.870
Is equal to probability of an intersection between the Section B, the intersection before given E and

08:45.880 --> 08:52.420
the probability of A divided by probability of one intersection, probability of BIDU intersection,

08:52.420 --> 08:54.040
probability of B three and so on.

08:55.650 --> 08:58.260
Now, can we record this?

08:59.910 --> 09:09.690
Can we re establish this particular thing to reestablish this week and also write this as probability

09:09.690 --> 09:17.070
of BE1 given E in into probability, agree to give an E in to probability of victory given and so on?

09:17.570 --> 09:18.570
And why is that?

09:18.570 --> 09:26.790
So if they are to find out the probability of multiple endives, given one condition, then if the.

09:27.960 --> 09:35.380
Different conditions are independent of each other, then they could be said to be multiplied.

09:35.670 --> 09:41.880
So when we are finding out probability and different conditions are occurring together, then we can

09:42.090 --> 09:46.700
find out the probability of one thing and multiplied with the probability of the other one.

09:47.400 --> 09:54.140
That is how we calculate probabilities so we can subdivide this and find out probability of given the

09:54.420 --> 10:01.050
probability of being given a probability of ubani and hence find out the probability of a given we when

10:01.050 --> 10:01.730
be do be three.

10:03.270 --> 10:07.830
So to saw this kind of problem, we can use this.

10:08.960 --> 10:17.840
Particular formula, which we have from the ninth base equation and VI is the base equation.

10:17.870 --> 10:22.270
Why is this particular algorithm called Knife?

10:22.730 --> 10:32.870
The equation is based Hürrem, but this algorithm is called Navys because it assumes that all these

10:32.870 --> 10:35.560
BE1 V to be three are independent.

10:36.470 --> 10:44.510
That is the reason why the first thing which we do while creating the data for this particular algorithm

10:44.510 --> 10:47.840
is we remove all the correlations.

10:49.050 --> 10:56.520
Which we have already learned during our data preparation, that is we will remove all the related variables

10:56.670 --> 11:05.100
and we will remove all the variables will have to be present so that all of these attributes be one

11:05.100 --> 11:07.970
be to be three are independent of each other.

11:10.730 --> 11:12.740
So what is Meyvis?

11:14.220 --> 11:22.500
The night vision classifier is based on the beast Hürrem, with the independence assumption between

11:22.500 --> 11:29.280
the predictors, so between the predictors, these are the predictors X one extra extra X for values.

11:29.490 --> 11:36.240
It is assuming that all of these predictors are independent from each other.

11:37.260 --> 11:43.130
A NIMBY's model is easy to break with, the more complicated.

11:43.140 --> 11:51.360
If I drew the barometer estimation, which makes it particularly useful for a large dataset now for

11:51.360 --> 11:53.030
knives, we don't have to.

11:53.060 --> 11:57.330
I daily find out values for different Fatah leaders.

11:57.330 --> 11:59.540
We just need to find out probabilities.

11:59.820 --> 12:03.900
So that is easily done for a very large dataset.

12:05.190 --> 12:13.590
Now, although it is simple knives in classified, it often does surprisingly well and is widely used

12:13.590 --> 12:21.810
because it often outperforms the more sophisticated classification methods, so it might outperform

12:21.960 --> 12:24.430
random forest or extra boost.

12:24.680 --> 12:29.400
So that is why Nijhuis is one of the favorite algorithms.

12:31.780 --> 12:35.760
So what about the Elgort and what do we have in the algorithm?

12:36.040 --> 12:45.250
So for this algorithm, the base theorem provides a way of calculating the posterior probability that

12:45.250 --> 12:55.000
this probability of C given X or probability of Vivan human X from the prior prior is what data we already

12:55.000 --> 12:55.270
have.

12:55.270 --> 13:02.050
That is probability of C operating independently, probability of X acting independently, and probability

13:02.050 --> 13:04.680
of X given C..

13:05.320 --> 13:13.480
So we already have this data and using all this data, we just want to find out the probability of C

13:13.480 --> 13:17.140
given X or probability of Y given X.

13:18.310 --> 13:26.800
The prior probability is the probability of an event before new data is collected and posterior probability

13:26.800 --> 13:33.070
is the revised probability of an event occurring after taking into consideration new information.

13:33.490 --> 13:41.890
OK, now posterior probability is the probability of event e occurring given that event, event B has

13:41.890 --> 13:42.830
already occurred.

13:43.060 --> 13:46.000
So what are these event B, these events?

13:46.030 --> 13:54.460
These are nothing but the predictors, the probabilities of the features and the attribute having those

13:54.460 --> 13:56.240
values which they already have.

13:56.590 --> 14:05.080
Now the Navy's classifier assumes that the effect of the value of a predictor on a given Class C is

14:05.080 --> 14:08.920
independent of the values of other predictors.

14:09.840 --> 14:19.290
So for one column, that is let's say we have three features age, gender and salary, then the impact

14:19.290 --> 14:26.010
of age is independent of the impact of salary or the impact of gender.

14:26.160 --> 14:31.280
So that is the main assumption, and that is why it is called knife tuto.

14:32.470 --> 14:39.850
Now, this assumption is called conditional independence, and it is called because of the glass conditional

14:39.850 --> 14:41.000
independence only.

14:41.470 --> 14:45.400
So that is why the Navy's got the name in.

14:47.160 --> 14:53.490
OK, so the main task here is to find out the probability of E!

14:53.700 --> 14:56.840
That is why Vidi got a good value.

14:56.850 --> 15:04.980
The probability of a class having occurred with respect to the different feature and attribute values

15:05.220 --> 15:07.410
already have been occurring.

15:07.860 --> 15:09.950
So how do we do that?

15:10.140 --> 15:13.200
So let us solve this problem first.

15:13.860 --> 15:15.680
So we have this data.

15:16.380 --> 15:22.250
This is the data that you would have already seen during the decision tree creation.

15:22.440 --> 15:31.350
So we looked at the data where we had our rainy, overcast and sunny and the first split which we had

15:31.350 --> 15:35.970
made was using rainy, overcast and sunny.

15:36.450 --> 15:42.000
And then we have temperature, different temperature values, different humidity values and different

15:42.000 --> 15:42.900
Vendy values.

15:43.080 --> 15:49.260
And based on this, we actually decided if the Chinese should play or not.

15:51.200 --> 15:59.990
So how do we do this, so we have this data, so from this particular data, we will create a frequency

15:59.990 --> 16:03.170
table that is the number of occurrences of these values.

16:03.440 --> 16:05.810
So we will check the frequencies.

16:06.080 --> 16:13.500
So the frequency table for our different outlook values will be for Sunee play.

16:13.520 --> 16:19.640
Golf has three yeses and doulos for overcast play.

16:19.640 --> 16:24.610
Golf has for yes and zero news for me.

16:25.010 --> 16:28.520
Play Golf has two yes and three no's.

16:29.530 --> 16:33.340
Now, from this, we will create the likelihood.

16:34.180 --> 16:37.690
How do we create that so we have three values here.

16:39.320 --> 16:41.960
And the total number of values I.

16:42.970 --> 16:43.480
Nine.

16:44.590 --> 16:46.510
Three plus four plus two.

16:46.750 --> 16:52.350
That is nine, so we see three by nine, four by nine, two by nine.

16:52.750 --> 17:00.440
So Sonny has three by nine of yesses, overcast has four by nine of us, and really has to by nine orfeus.

17:02.140 --> 17:10.090
So we get nine by 14, so nine items out of 14 have yes, in our.

17:11.440 --> 17:17.380
Similarly, we find out the similar table for no, we calculate the same thing for No.

17:18.940 --> 17:28.260
And we have to find out the probability of X given or probability of it being Sunee given, it is yes.

17:29.020 --> 17:33.580
So probability of having Sunee given it is yesses three by nine.

17:36.430 --> 17:36.850
Right.

17:38.090 --> 17:39.940
Dorville, yes, nine.

17:41.190 --> 17:50.220
And there are three entities with Sunny, so the probability of getting sunny as a result, given it

17:50.220 --> 17:53.110
is yes, is three by nine.

17:53.940 --> 18:00.660
Similarly, we can find out the ratios for overcast, rainy and.

18:02.630 --> 18:09.440
From this, we can calculate the probability of yes and the probability of sunny, so the probability

18:09.440 --> 18:13.230
of yes is nine by 14, that is nine times.

18:13.250 --> 18:18.020
It is, yes, and hopefully 14 data points out there.

18:19.090 --> 18:24.580
Then the probability of it being sunny is five by 40.

18:25.610 --> 18:31.910
Similarly, we can find out the probability of it being overcast, probability of it being rainy.

18:33.230 --> 18:36.100
That is four by 14, five by 14.

18:37.550 --> 18:46.730
Now, what is the probability, the probability is probability of yes, given it is sunny, so what

18:46.730 --> 18:48.040
how will we find this out?

18:48.260 --> 18:51.410
We will find this out by multiplying the values.

18:52.070 --> 19:00.950
So it comes out to be zero point three three in zero point six four in zero point, divided by zero

19:00.950 --> 19:01.970
point three six.

19:03.920 --> 19:12.850
That is probability of yes, given it is sunny is equal to probability of sunny, given it is, yes.

19:13.150 --> 19:16.750
And the probability of it being.

19:18.630 --> 19:22.350
Yes, divided by the probability of.

19:23.210 --> 19:28.850
Sunny, this is just the simplest implementation of the nine best.

19:29.830 --> 19:32.740
Formula, the simplest implementation of this formula.

19:34.470 --> 19:41.190
You can pause the slide and have a look at this, how this is performing, because it is very important

19:41.190 --> 19:47.880
to understand so you can pause any time and have a look at this table and understand how this has been

19:47.880 --> 19:48.750
constructed.

19:51.830 --> 19:59.270
Next, we will find out the probability of no, given it is sunny, so the probability of no, given

19:59.270 --> 20:07.310
it is sunny, will be the probability of sunny, given it is no end to the probability of no divided

20:07.310 --> 20:09.560
by probability of it being sunny.

20:13.560 --> 20:21.270
Similarly, we will create different likely would be moods and frequency tables for humidity, temperature

20:21.270 --> 20:21.940
and windy.

20:22.140 --> 20:26.460
So for all all four of the features, we will create the stable.

20:28.660 --> 20:35.410
Now, when we want to find out if someone has to play, then how would we do that?

20:35.680 --> 20:43.370
We will do that using we will be finding all probability of yes, given different X values.

20:43.510 --> 20:45.060
So what are the X values?

20:45.070 --> 20:45.560
Let's see.

20:45.590 --> 20:48.960
We want to find out for the rainy outlook.

20:48.970 --> 20:51.340
Temperature, cool, humidity, high and windy.

20:51.610 --> 20:53.460
So how will we find this out?

20:53.740 --> 20:58.510
So probability of yes, given X will be probability of.

21:04.860 --> 21:15.150
So probability of a given certain conditions is equal to probability of condition, one, given a probability

21:15.150 --> 21:22.690
of condition to give given be given a probability of condition to be given in to probability of a..

21:23.060 --> 21:24.330
So let us get to that.

21:26.350 --> 21:33.910
So probability of condition given, yes, probability of another condition given in the probability

21:33.910 --> 21:35.350
of another condition given.

21:35.350 --> 21:42.310
Yes, in all probability of next condition, that is probability of rule given.

21:42.310 --> 21:43.850
Yes, indeed.

21:43.900 --> 21:45.790
Probability of yes.

21:54.770 --> 22:04.190
So what do we get from this weekend, probability of yes, given X as zero point zero zero five two

22:04.190 --> 22:04.490
nine.

22:05.520 --> 22:09.510
Now, we will divide this value by.

22:10.610 --> 22:12.980
The probability of.

22:15.170 --> 22:17.060
Intersection of all of these.

22:18.760 --> 22:21.880
So the probability of intersection of all of these will be.

22:23.120 --> 22:26.780
This some value, so this is what the result will be.

22:27.020 --> 22:30.930
Similarly, we can calculate the probability of no given XL's.

22:31.810 --> 22:33.460
And you can see it is.

22:35.560 --> 22:41.290
Contrasting to this one, so the probability of us given X is zero point two and the probability of

22:41.290 --> 22:44.080
no given exists zero point eight.

22:46.960 --> 22:54.730
So this is the end of my base, I will be providing another example question to you so that you can

22:54.730 --> 23:01.170
practice that and find out the values of probabilities using the base formula.

23:01.180 --> 23:02.470
And I visited him.

23:02.980 --> 23:11.020
And in the next session, we will be implementing my base algorithm using Escalon.
