Hello and welcome back.
Today we're talking about the importance of splitting
your data set into a training set and a test set.
Let's imagine that you are tasked to predict the sale prices of cars.
And that is your dependent variable.
And your independent variables are the mileage of the car.
And its age.
And in your, data that was supplied to you, you have 20 cars in total.
Of course, that's not a lot, but for illustrative purposes,
for our tutorial, that will be sufficient.
So what splitting your data implies
is, separating a part of your data out.
before you do anything.
And usually that's about 20% of the data.
So since we have, 20 cars here, that's about four cars that we separate out.
So what that means is that the bulk of our data, 80%, will be our training set,
and the separated 20% will be our test set.
We'll use our training set to build the model.
So in this case we're building a linear regression.
And then we will take the cars from the test set.
We will apply our model to them.
So they haven't been part of the model creation process.
The model has no information about these cars.
And now we're applying this model to them.
And it's predicting certain, values, certain prices.
But the good news is that because this is something we separated in advance
as part of the data that was given to us, we actually know the actual prices.
So now we can compare the predicted values,
which were generated using a model that has never seen these cars before.
And we can compare that to the actual values that we know
what these cars sold for.
And so from that we can evaluate our model.
Is it doing a good job.
Is it doing a not so good job.
And do we need to improve it.
And that's how we split a training set and a test set.
And that's why it's important to do that.
I look forward to seeing you in the next tutorial.
And until then, enjoy machine learning.