Hello, in this session, we are going to learn what exactly this cross-validation and what type of
scenarios in what type of use case, if this this cross-validation will play a vital role aurier in
what it what type of use cases.
So we have to understand this and we have to also understand how this cross-validation increases our
accuracy.
We have to also understand exi so you have to use case for whatever you if you have, let's say you
have some use give, let's say whatever you is, let's say you have some regression use case or whether
you have some classifications.
So what you can do if you have to split this data so that if you have to split this data using inbuilt
functional side, good.
You don't have to define a custom function.
And if you want to find, you can define it as well, it's all up to you.
So basically, you have a inbuilt function known as that's displayed.
And here what you have to do, you have to basically pass your independent data or you independent features
that may contain any number of features inside.
Let's say here you have 10 columns.
And exactly here you have your dependent feature XY, ENVI, and after it you have an additional parameter
known as Rano underscore.
It definitely plays an important role in time of your rating.
So let's see if I'm going to see my renderman.
This state is zero for what it will do.
It says it says, yeah, you can select, you can select the number of roles in a randomly selected.
It will exactly return me my four parameters.
So here I'm going to say as it's the X underscore train and X on the school test, then we have something
with Y in the school and something núñez Y and the school test.
So this will exactly return me my these four parameters.
So here what we will do, let's see if we have random underscores equal to zero.
So in such case my training data, in such case my training it, or I can see in my training data,
I have some, I have some other data points.
Similarly, if I will see in my random one state, if it is to see here, my training data will get
changed.
So whenever I am trying to change this value my training data as well as my testing it, like me, it
is it.
So here I have test data.
Here I have Bastida, so whenever I try to play with this random one, let's go straight barometer,
it will change data each and every time.
It will take this training data and testing data each and every time.
So here you have something known as a school site.
Let's say I'm going to say my test side is that seventy five percent.
It means you'll soon be five percent data is your training data and twenty five percent, your seventy
five percent is your test and twenty five percent, will you estimate that's what is the meaning of
this.
So whenever you are trying to play with this at random with a twisted parameter, so it will always
change this training data and it will always change Bastida as well from my entire dataset.
So if my data changes, it means it will change with accuracy as well, because if my data changes,
whatever deletion my model will run each and every time, my model will learn some new relationship,
some new relationship.
So at a time of prediction, it will give some some some different accuracy.
Let's say let's say the first time it will give me let's say I have 80 percent accuracy or 81 percent
accuracy when I demonstrate a zero.
But when I'm trying to do it, it will give me somewhere around accuracy, let's see, 79 percent or
zero point seven.
Similarly, if I play with the enemy scored, let's say in this time I have, let's say twenty six.
So this time, like similar accuracy goes a little bit higher.
So if I am again going to play with this line, I'm betting that each and every time, each and every
time this accuracy will fluctuate, I shoot that it will raise over here what is what is the exact accuracy
of my model so that I will whenever we open a new page like opening.
So whenever whatever data you have, if on data, whatever machine learning algorithm you are going
to apply and whatever accuracy you will get.
Do not notify as I have achieved, let's say if you achieve 84 percent.
So do not say yes, do not dummies here.
I have achieved this 84 percent accuracy always say yup, I have achieved accuracy between this, this
certain range.
Let's see, let's see this.
Seventy seven to eighty nine percent.
Let's say I have achieved accuracy between this range because each and every time when a random barometer
changes, it will definitely impact your actions.
Yes.
So how to get rid of this issue, how to get rid of this accuracy issue?
Because each and every time your accuracy fluctuates to get rid of this issue, we have something known
as cross-validation.
We have something known as cross validation, which is exactly my CV.
So there are tons of approaches.
There are tons of apples, literally.
Let's say I have something known as careful approach.
I have something known as grid search approach where literally there are thousands of approaches.
You can also perform your menu that protested and say I have some randomized search.
Randomized, such randomized, such cross-validation, I have something genetic algorithm that are latest
algorithms that that don't.
I have something known as Octonal.
So these are the kinds of approaches to do cross-validation on the data or only model.
So let's see what exactly the meaning of this cross-validation.
Feleti my cross-validation value, which is default five.
So what is the meaning of this cross-validation?
It means I have to cross validate my data five times.
So what is the meaning of this cross validation of data five 10.
So let's say you have thousand records in your data.
So at first time, at first time, what will happen?
Let's say what it will do.
It will basically create chunks.
Let's say the first chunk, second is third is fourth and fifth, and in the end, the first cross-validation
went at at my first cross-validation first time, I can see first.
So it will consider the last 20 percent of data.
It will cost the last 20 percent of data as my first data and remaining as 80 percent will be considered
as my training data, which I have played my model on this 80 percent.
Then I have a prediction on this 20 percent.
Similarly, when my cross-validation gets to it means a second iteration, it means a second iteration.
So what will happen?
All the similarly at second iteration.
You're your first 60 percent in the first 60 percent data and this last 20 percent data and this one
and this entire 60 percent will be your training data.
Will be your training data and and don't people think this 20 percent will be tested on which you have
to prediction on which you have to prediction?
Similarly, when your CV is three, let's say let me open a new page.
Let's see when my what I can say at Atara Attrition.
Right.
This is three.
Let's see.
This is my third iteration.
So tonight, what will happen?
Let me let me let me try it again.
So this is 20, this is 22, this is 20.
And this is, again, 20 and it will say 100 percent.
So this at this third iteration, this 20 percent will be exactly tested at rest will be my training
data and what will happen in my field, what will happen in my full time.
Let me let me move all these things through my fourth iteration.
This 20 percent gate gets my tested.
Similarly, in fifth iteration, this will be considered as my best data addressed all of my training
data.
That's what happened when cross-validation with with exactly my five.
Well, exactly my fight, so definitely, you know, it means each and every chunk of data in each and
every chunk of data, you have some kind of accuracy.
So let's say at my first iteration, you have something accuracy, one that a second attrition you have
access to.
And third, then you have four titration four.
And definitely you will get all the five accuracy.
Then what you can do, you can compute mean of all this accuracy.
That will definitely give your final accuracy.
So that's that's the advantage of choosing your cross to validate your model.
So that's all about the session.
In the upcoming session.
We are going to learn what exactly this grid search, what are these randomizer and all these types
of algorithms.
And, you know, we are trying to understand how it is used with respect to machine learning, how it
is exactly used.
So we have to understand also this one.
So that's all about this whole you will love the session very much.
Thank you, guys.
Have a nice day.
Keep learning.
Keep growing.
Keep practicing.