Hello, everyone.
In this video, we will learn how to split our available data and do best and green site.
Then we will train our more than on training set and we'll find Artist Square on our test site to create
a screen is split.
First, we need to import the function.
That string is split from a skillern.
So we'll write from a scalar Todmorden selection.
Import.
Green essed split.
Not to use this function.
We first need to define what, four variables.
That is our independent green variable.
A word independent, best variable, the number dependent green variable and then dependent variable.
So we cleared this forward variable.
Will write X underscored crème.
Will rate X and the school best.
And best school crane.
And why underscore best?
These are our four day doorframes, and this will get the value of the output of our grain test, split
functions will right grain underscore test.
And and record will first mention the word independent variable, which is x multi.
Then our dependent variable, which is why mighty few remember we cleared this very well, no last lecture.
Then the next parameter is first size.
As mentioned in our two lecture, we are splitting our data and it between data issue.
So what, a two percent of data will go and do training set and or 20 percent of data will go in to
test site.
That's where here we will mention zero point two.
This zero point two means 20 percent of data will go into S.A.S..
And the last parameter is randomizer.
There's the random number you can give any integer value.
We are providing this number just to get the same sample every time.
So if I mentioned random, say, Dick, we do one every time while running this string site.
Every time my training and test site will remain the same.
So even if you are using the same random instead as we are using, you will also get the same training
site.
So we'll just mention random estate, this Siedel.
If you're on Bilger, the same training set, you should also mention random as soon as zero.
Now, just to check the number of rows and columns in our training and tests, it will, right, Brent?
Ex.
Underscore green dot ship, dot ship.
Will you give me the number of Lauzen columns?
Now you can see it, three percent of our data is ingraining set.
So four hundred and four observations are in our training set and rest of one zero two observations
are an asset.
No, we will follow the standard process of creating a linear regression model will first create an
object.
This time we will name it LMA underscore a.
And will equate it only needed.
Now we will train our model from our training set that is extreme and by train, right?
Lemon scored a dog fit, then we will mention our training set, which is X under school train and went
to school in.
This statement will fit a lot more than on our training site.
Now, let's clear the predicted value of Y using this model.
So we will, right.
Why underscore test?
Underscored a.
Equal to L.M. a dot.
Predict.
Here I am predicting way that's dependent variable, so I will give my best independent variable.
So I will rate.
X underscored test.
But on this.
I have my predicted value of test set, why underscore best underscore a similarly we will create by
underscore Crane underscore a deal that the predicted will use.
Of Overclaiming said.
This time, we will use X and a school crane.
Now to check the artist square value for our training and test data.
We will import another function.
Well, write from a skill under my tricks import.
Import, I do.
And let's go to Scott.
You don't have to learn on this in Texas, you can just save a copy of this notebook or you can search
online.
The Syntex are readily available online.
Now, to get the artist squirrelly, we just need to mention art to underscored his score.
This is a function we imported.
If we want to get more detail about dysfunction, we can just certitude and help by using Questionmark
operator.
You can just write Questionmark.
And if we.
We will get all the details.
So here, if you see.
In this index.
We need to mention our why underscore grue, which is the reason why we lose, then we need to mention
the way predicted values.
Would he do the same and just close this?
Right out to underscore school to school.
And then record will first rate.
Why underscore?
This.
So why underscore test is our original value and why underscore tests underscore A is the predicted
value of 581.
So we'll just run this.
So the artist's good value is zero point five for.
Now, let's get the artist good value for our training, said.
We on this artist, good value for our training set is zero point seven five.
You can also see that the artist's good value for our test data is less than the artist's good value
for our training, said.
As we discuss in the world to be lectures that test artists good value is of more importance as compared
to training said.
And we should always look at our test score instead of training discrete values to evaluate the performance
of our modern.
That so you split your due time to test Trent Green in Biton.