I don't know if we have discussed about the supervised learning models, we have discussed about the
linear regression and they have understood why aggression is used, meaning aggression is used for finding
out continuous values.
Now I want to find out something like height, weight or Cecile's price.
In those situations, I can easily use linear regression.
But now we have another type of problem, which is logistic problem, which is a problem where we want
to find both different classes.
We want to find out if a particular value is yes or no.
We want to find out answer to a problem.
That is, if someone will buy my product or not, whether someone should default on a loan or not.
So these are different type of problems which we will be solving on in case of logistic regression.
But why is it called regression when we are not really doing regression?
Right.
Regression means that we want to predict continuous values, but in logistic regression we are doing
classification.
That is, we are trying to find out the answer to a class that is a categorical variable.
That is, we want to find out if someone is a particular animal, it is a cat or not, or if someone
will default on a loan or not, if someone will buy my product or not solve some problem which has us
a high class problem.
So these type of problems should not be considered like a regression problem.
Right.
But still, we are calling it a regression problem.
Now, this is because not because it is a regression algorithm.
It is classification algorithm only.
But the problem is that the logistic regression is using regression in donelli in the calculations,
and only it is performing some kind of regression.
That is the reason why we are calling it logistic regression back.
Logistic regression is used for classification problems while for continuous value problems for regression
problems.
We use linear regression.
So this is something which you need to keep in mind always.
Now, you have seen how the model continues, medic responds with limited aggression technique, but
in many business scenarios, our target is binary in nature by any means, something which has the answer,
zero or one.
So, for example, whether someone will buy my product, whether someone will default on a loan or not.
So answer to all of these question and many other such questions is yes or no.
We can convert that to zero and one and then try to model them with linear regression technique, but
that does not give good result.
So let's have a look.
So let us have a look at this particular image here now in this particular image, we have the data
point like this.
That is one of the barometer.
One of the target value is zettl and another target value is one.
Now, in this case, if I will apply a linear regression and I will try to put a line here, then the
line will not be able to satisfy the problem because it is going diagonally from the data on my glasses
on like this.
So how will I make my decisions with such kind of a line?
So you can see how far badly this will feel, and that is why we really need something like this, so
what we need is we will create something like this, the image which is present Velu.
Now, to actually reach to this point, to actually reach to this kind of construct, which will give
us this kind of line, this kind of goal, which will be able to map to this data, which is in a class
form, we will have to develop certain kind of understanding.
So then now we have seen that regression approach will feel at different levels.
So we will have to look at these kind of problems from a different perspective.
So let us consider the particular data where we have different values for yes, no, yes, no.
And different age values.
So in this condition for this particular type of data, here we were we ask the children of various
ages whether they are afraid of ghost or not.
Now, here we have different answers from these children.
So the children of age four, there are four children who say yes, one child who says no.
There are three children of age five who say yes to say no.
Six of three to children of age six who say yes and so on.
So now what we will do.
Now, if someone will ask a question that what might be the response for a child who's ages seven,
then you can see that the response will be no, because here the majority of the children of age seven
have responded with no right.
So what did you do there to find out?
You found out the probability of it.
You would just simply check and the probability of the response being low when the age is seven and
you naturally guessed that the answer will be no.
So in this case, we did not model why we did not find out the value.
We simply create a model for the probability.
So in this case, what we will be doing is we will simply create the model with probability of Vike
will do.
Yes.
Or probability of equal to no.
So for this, we will be leaders of the north, this entire thing, by being the probability so we can
see visible to be done on, plus be the one with the X one, plus BWB likes to be WB Deakes.
So these are the equation which we used to have for integration.
But now we are not finding out the Nenad equation.
We are not actually finding out the continuous value, but we are finding out the probability.
So we will say that this should be the probability of this equation, this probability.
We will assign it as the probability.
Now, this will be a little problematic because the probability value has to range from zero to one,
while the regression value of this particular equation value will range from minus infinity to plus
infinity.
Now, for this, we will have to transform this particular equation that must be done on.
Plus, with our next month, as we do X plus, we get to expand so on into a particular range where
this will range from zero to one, then we can use this equation to find out the probability.
Now, let us go back.
Now, let us see what are we trying to predict here?
Now the classes which are being predicted.
So here we are trying to predict different classes and we are not predicting continuous numbers.
So that does not target.
We are not solving the problem.
The name only has logistic regression, but the main purpose here is to solve a classification problem.
So what are different types of classes, which would be the different type of classes for the dog or
dog bus or field?
Yes or no approval or rejection.
So these are these two types of values which could be placed in the logistic regression problem.
Now, these two classes should be of a type which are more possible together, like someone cannot force
and feel the exam the same thing.
So we cannot have something which can occur together.
An animal cannot be OK and go vote together.
I'm the same thing.
It has to be either a gag order, but a person has to either pass the exam or fail exam.
Right.
So now the probability of the outcome being in favor of one class as finding out just how class may
not be enough to clarify the understanding.
So let's see if I.
Simply find out the hard place that is something is a gap or something is a dog that can be a feasible
solution because I want to know more about.
Simply knowing that a person let us see, we have an example here that we are trying to predict whether
a particular person might have a heart disease or not for their particular ages.
Now, if they say yes for both age 45 and 85, that is not informative enough because a person was ages
45 will have less probability of having a heart disease in comparison to person whose age is eighty
five, the person whose ages 85 is obviously more at risk of having a heart disease.
So for solving such problems, we actually need to know the probability of something happening if we
have a patient, a cancer patient, a person who is destined for cancer, and I simply say that you
have cancer.
Yes or no, that is not informative enough.
I want to know, what are the chances of someone's death?
Would it be considered normal?
So I need to know if there is a 90 percent chance of someone having cancer or there is a 10 percent
chance of someone having cancer.
And based on that, I can actually prescribe the next step.
That is what kind of test that person should have or what kind of medicines that person should have.
So those things will be dependent on the probability, which I will be getting Golia.
Right.
So this implies that we want to find out the probability of the value being one given access to that
is we want to find out probability of an animal being gagged, given that it has certain characteristics.
For example, the characteristics would be the animal, says M. or the animal has whiskers on the face.
So these are different kind of characteristics which we have.
So we want to find out we want to predict the probability of vibin one given X, so what are the difference
between linear regression and logistic regression?
The difference is that of the target value for one that is in linear regression.
We want to find out the continuous dependent variable, the value which we are trying to predict is
a continuous dependent variable.
In case of logistic regression, we want to find out about certain classes that is either a value zero
or one based on the probability value, which will be ranging from zero to one.
All that is we are trying to find out a value which is between range zero and one, while in case of
linear regression, we want to find out the value, which is ranging from minus infinity to plus infinity,
because cantinas value will be ranging from minus infinity to plus infinity, while the probabilities,
the probability ranges from zero to one.
Now, what are different, but we will see just for linear regression, the attributes are independent
variables.
These can be continuous or discrete in nature.
And in case of logistic regression, the again, the variables can be continuous or discrete.
So there is a similar kind of you just can be present in both.
Now, what is the equation that we are forming in case of media regression, the equation which is formed
in case of regression, is in the form visible to be done, or plus B, the one in two X one plus some
particular added value by in case of logistic regression, the equation is probability is equal to one
upon one plus E to the power minus the same equation for linear equation be done or plus B that takes
one plus B that we do and so on.
So how we form this equation is what we will learn in this particular session.
But for now, you can just know that this is the equation for logistic regression.
Now, what are the different type of problems which we solve in case of linear regression, these are
temperature marks of student.
What are the future scenes?
What are the prices of commodities?
These are different things which we're finding out in case of linear regression, in case of logistic
regression, what we're finding out in days of logistic regression, we are finding of the binary classes.
That is if if an animal is cat or dog.
If someone passes or fails the examination, if the loan would be approved or rejected.
So these are different kind of things which we predict in case of logistic regression.
Now, let's go for the.
Now, what is the definition of logistic regression?
The logistic regression technique is used for finding out results which can be presented in the binary
zero or one or two or four or more yes or no values means that the outcome could only be in either one
form or of the two.
For example, it can be utilized when we need to find the probability of success or failure of an event.
So here we are finding out if a particular animal is a gag order dog, and here we are finding out the
values from either buy is equal to zero or V. is equal to one.
This we have already seen that this is the linear equation, which gives us the continuous values which
would which would not be of much use if we want to classify Target into two different classes because
the Nenad equation will not be able to map these values.
So to map linear regression equation such that we could get above as shown in figure to.
Which could give us values.
Close to zero and one for a given attribute.
So that is our objective here.
So why is it called aggression, if it is finding out biology classes, so it is underlying Dick is
quite similar to linear regression.
So as we know, the equation which we will be creating would be kind of using the linear regression
equation, but only the Wii will be switched with the probability value.
So that logic is taken from the logic function.
This is the logic function is one upon one plus E to the power minus the.
So that that is used in this classification, so we will be using this logic function for this classification.
We will be converting.
This is equal to be not to be done or the speed of the next one plus two weeks to still be three extreme
two.
This kind of equation, that is the logit equation, that is one point, one plus or minus mid-north
authors with our next one plus 21.
So our task here is to convert this linear model into the logistic model.
So there is this log function which will take care of the range mismatch issue, how this happens,
we will have a look at it in the next session where we will study about the mathematics behind the logistic
regression.
So let's go to the next session.