How do I wake up in the previous lessons, we build three predictive models.
That is the linear regression model, the random forest regression model.
And finally, the gradient boosting model.
We also saw that among the three models, the gradient boosting model gave us the best results in this
lesson.
We are going to learn about creating ensembles of our existing models and applying them.
But before that, let us know what ensemble exactly is.
Ensemble modelling is a process where multiple diverse models are applied to doing better predictive
performance than could be obtained from any of the constituent learning algorithms alone.
We have three predictive models linear regression, random forest and gradient boosting.
Now we will create an ensemble model by averaging the predictions of all the three models.
And after we average the predictions, we save them in a new variable and then check the RNC and ask
a score of the ensemble's model.
So the SC for the ensemble model comes out to be four to nine, one point three two and Oscar score
is zero point eight eight.
We can observe that we have good accuracy as compared to the gradient boosting alone when compared to
the ensemble model, so we can find out the alternative way to do this.
What we observed from our three models was that out of all the three models, great and boosting works
best then the random forest and then linear regression so we can build a weighted average model.
What I'm trying to say is that we can give waves to each of the models prediction, keeping in mind
that Autumn Essy and R-squared score.
This will help us build a more accurate ensemble model.
So we give 50 percent rate to gradient, boosting 30 percent to random forest and 20 percent to linear
regression, and then we total them all.
And then with these new predictions, we can check for the autumn AC and our square score and the autumn
comes out to be four one six seven point four and our square score a zero point each night.
And what we conclude after looking at the RNC and R-squared score is that gradient boosting works best
of all.
So our next step is to cross Moledet, we are going to perform cross-validation first, let me tell
you what cross-validation as well.
Cross-validation is a resampling procedure which is used to evaluate our machine learning models on
limited data samples.
So basically, in simple words, the goal of cross-validation is to test the model's ability to predict
new data that was not used in estimating it.
It has a single parameter, Kawalsky, which indicates the number of groups that the data would be split
into.
So to perform cross-validation, we import the Cross Vänskä from Escalon Model Selection and we use
Model three, which is a gradient boosting model and specify the value of K as five.
This returns us the scores for each five groups and the scores do not really much.
That means the model is pretty good.
And here we come to the end of this lesson.
So let us meet in the next lesson where we will compare our models to and keep learning and by.