Now, once our data is ready, the first step that we take is to split the data into two parts.
The first part will be called the training set.
This part will be used to train the model and then that will be a second set.
That second set will be Kordic tested and that test set will be used to test the performance of the
created model.
So in business and adio, if you have a lot of data, it is always recommended that you train the model
on one set of observations and you keep one set of observations which are not shown into your model.
You test your performance or your offer model on this previously unseen data.
Usually we do a split of 80 20.
That is, we use 80 percent of the data available to train the model and 20 percent of the remaining
data to test the performance.
So here I am showing you how to split the available data into two parts to split the data in are we
use this package called See It tools.
If you have this package in stolen art, it will be visible here in the packages part so you can scroll
and see if see it is available with you or not.
If it is not your undies, come on in.
Stalled out packages.
See Édouard.
No doubt see it tools is written in single quotation marks.
So we'll run this command.
And it has installed seer tools in the packages.
You can see that see a tool is available here.
Now it is installed, but it is not active.
That is, it cannot be used.
As of now to make it active.
We run this library command.
You can also take this checkbox to will run this library command.
And you can see that a tick comes here.
And this year, tools package is now active.
The next step is setting seed.
We set seed so that we have reproducible results.
What I mean by this is when we are doing a test transplant, we'll be randomly putting 80 percent of
the data into printed and 20 percent of the data to test it.
If we do not succeed, my randomly selected 80 percent of the data will be different than your randomly
selected 80 percent of the data.
But if we set seed to zero.
If you also said the seed to zero and if I have said the seed to zero here, both of us will be getting
these same split of data.
And if we both get same speed of test and train data, we both will get the same model and that same
model will be giving us these same results.
So that is why we are setting the seed to zero hit.
Next will create a variable called split in the split variable.
We will have value.
True and false.
And we are giving a split ratio.
Point eight, which means that 80 percent of the values will be true and 20 percent will be false.
So if I run this command, you can see that a split variable is created here, which contains value
through brute rule force and so on.
And randomly, nearly 80 percent of these values will be true and nearly 20 percent will be false.
Now, in my training said, I'll be taking all the movie data set values which have split value through.
And indeed, they said, I'll have all the movie data set values which have split value falls.
I've named this variable as Trinity because for now we are doing classification.
That is, we are trying to predict a very well with this categorical later on in the course.
We'll also see how to do regression in swim.
So here I have created two variables Rainsy and D.C. Green.
He will get values from what we dataset, which has split value through.
So at underscore my.
And you can see nearly 80 percent, which is nearly 400 observations are getting stored in the trains
very well.
And I also found this one, which is DWC.
And I have one hundred eight observations in my test dataset.
This is how we split the data in two days and Drame will be using the brain to do does it to rain as
a model.
And later on, we will compare its performance on the test see dataset.