How it works...

In Step 1, we imported the required packages. In Step 2, we separated the feature set and the response variable from our dataset. We split our dataset into training and testing samples in Step 3.

Note that our response variable is continuous in nature. For this reason, we built our regression base learners in Step 4 using linear regression, SVR, and a decision tree. In Step 5, we passed our test dataset to the predict() function to predict our response variable. And finally, in Step 6, we added all of the predictions together and divided them by the number of base learners, which is three in our example.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset