And this lecture, we are going to discuss linear discriminant, analysis.
Although most of the courses do not cover this technique because it has a lot of mathematics and may
be difficult to understand for all audiences.
I think I can give you the intuition behind using a simple example.
And then when we do not analysis, I'll tell you how to interpret the result.
By the end, you will be confident in applying this technique and using it to solve your business problems.
As I told you earlier also that instead of logistic regression, this is the more preferred technique.
When we have multiclass responses.
Secondly, it is still simple enough to interpret the importance of different variables on the output
from this technique.
This is why LDA is one of the popular techniques for people in the marketing research area, also a
list based on base to them.
Let me show you an example of how this theorem is applied.
Suppose we have this table of students in a class.
We have three categories of height.
Low, medium and high.
And two categories of definiteness level, whether the outfit or Nordberg.
Now, the prediction problem is this.
I want to predict whether the student is fit, given that his height is medium.
So the probability of a student is faked.
Given that his height is medium, it's called conditional probability.
Since it is based on a precondition that the height is medium.
You can see since we have 40 students of medium height, out of which fifteen affect fifteen out of
forty is the probability of being fit.
Given the student is medium.
So this is how we calculate conditional probability.
Similarly, if we want the conditional D of student being not fit given the height of medium.
We will get it by dividing 25 by 40.
So conditional probability of being four days we've been before 40 of being not quite as qualified before
B a base classifier.
Find out these two conditional probabilities and assign declasse, which has the highest probability.
So since 25 or 40 is higher, it will assign declasse, not fit.
So I predicted variable was the category of height, given that a student belongs to medium height.
A model based on based classifier will classify that studying to be not fit because this section has
higher conditional probability.
So no, this is pretty straightforward.
And this is how based classified works.
But in practice, we do not have numbers like this.
Usually this hyd variable is a continuous variable.
And we can make this table.
Moreover, we do not have just one predictor variable.
We have a lot of continuous variables as predictive variables.
So to calculate the conditional probability in such a scenario becomes difficult.
So this straightforward calculation of conditional probability field in that case.
This is where based theorem of conditional probability is used.
Let me show you how space tourism is created.
If I want to find out the probability that a student is what medium and fit that is, these fifteen
students out of hundreds student.
So the probability of being medium, in fact, is we've been out of a hundred.
This we can get in two ways.
One is by going horizontally.
That is first finding or the probability of being fished out of medium student and then multiplying
it with the probability of being a medium height.
It's three digit presented here.
Fifteen by 40 to 40, 100.
Which is equal into fifteen.
Landed all by going vertically first.
Which is probably of having medium height, given that student is fit with just fifteen by 48 multiplied
by the radio being fished out of total Trent, which is 48 by a hundred.
So that is fifteen by it into forty eight by a hundred.
So you can see these two teams are equal.
If I move this time of forty by a hundred to this denominator, I can calculate this fifteen by 40 as
a combination of these three thumbs.
One dummies, fifteen by 48, which is conditional probability of being medium height and given fit.
Then is this forty eight by a hundred.
Now this probability of being fit and in the denominator we will have probability of being a medium
height.
It's student.
So fifteen to forty is equal to product of these two.
And divided by this time this formula is known as base to them of conditional probability.
So why did we go this long way instead of the straight fifteen 140?
Because usually these variables are continuous variables.
And there are a lot of different variables here.
So it is difficult to calculate this.
We've been before t straightaway.
We have to use these three other times to estimate the value of this conditional probability of fifteen
by 40.
So when we treat this formula for continuous predictors, the final formula for linear.
This current analysis looks something like this.
As you can see, it is looking very complicated.
That is why we did not discuss the mathematics behind the revision of this formula.
I hope you understood the example of how we are calculating conditional probabilities and how we are
assigning the response class.
Basically conditional probabilities of each response.
Class.
And this formula we have, these buy items, these Bynum's are known to us from the training, they
does it.
Which is basically telling us how many of all these students are fit or unfit.
These other parts are estimated.
This is some assumptions and the assumption that we make in linear discriminant analysis is that the
continuous variables are normally distributed.
That is, if we have high rates of student those height.
Have a normal distribution.
Normal distribution can be understood using the link of video.
I have given in the resources section.
So if this assumption of normal distribution is actually true in reality, linear discriminant analysis
predicts brilliantly.
If it is not the prediction, accuracy of Alea is not that high.
For most of the practical purposes, this assumption holds.
And the prediction accuracy of our model is usually good enough.
So let me summarize what a given set of predictor values and live will calculate the probability of
that observation belonging to each group.
Then whichever group has the highest probability that group is assigned to that observation.
So since this classification is mathematical, it can be proved that if the assumption of normal distribution
is correct, this classifier has the lowest possible theoretical error rate.
Note that we are taking the input values of X as it is and not making a complex function out of it.
This is why it is being called linear discriminant analysis.
However, if we create a function with exquisite.
It will be called quadratic discriminant analysis.
Since running both linear and quadratic discriminant analysis is simple.
In software packages, we'll be showing you how to run both of these.
After running the model, we will use the confusion matrix to check out the quality of prediction.
We can also compare the confusion matrix of Aldea Eudy and the logistic regression.
One last thing before I close this lecture, I told you earlier that if we want to change the Bondie
condition and logistic regression, we could do it.
We can do it here.
Also sense here also.
We are computing probabilities.
If you want to approve credit only if you are 80 percent sure you can change the boundary condition
to zero point eight instead of zero point for.
With a lead also.
So that's it for this lecture.
Hope you understand the intention behind linear discriminant, analysis and base classifiers.
See you in the next one.