Book Image

Hands-On Ensemble Learning with R

By : Prabhanjan Narayanachar Tattar
Book Image

Hands-On Ensemble Learning with R

By: Prabhanjan Narayanachar Tattar

Overview of this book

Ensemble techniques are used for combining two or more similar or dissimilar machine learning algorithms to create a stronger model. Such a model delivers superior prediction power and can give your datasets a boost in accuracy. Hands-On Ensemble Learning with R begins with the important statistical resampling methods. You will then walk through the central trilogy of ensemble techniques – bagging, random forest, and boosting – then you'll learn how they can be used to provide greater accuracy on large datasets using popular R packages. You will learn how to combine model predictions using different machine learning algorithms to build ensemble models. In addition to this, you will explore how to improve the performance of your ensemble models. By the end of this book, you will have learned how machine learning algorithms can be combined to reduce common problems and build simple efficient ensemble models with the help of real-world examples.
Table of Contents (17 chapters)
Hands-On Ensemble Learning with R
Contributors
Preface
12
What's Next?
Index

Pre-processing the housing data


The dataset was selected from www.kaggle.com and the title of the project is House Prices: Advanced Regression Techniques. The main files we will be using are test.csv and train.csv, and the files are available in the companion bundle package. A description of the variables can be found in the data_description.txt file. Further details, of course, can be obtained at https://www.kaggle.com/c/house-prices-advanced-regression-techniques/. The train dataset contains 1460 observations, while the test dataset contains 1459 observations. The price of the property is known only in the train dataset and are not available for those in the test dataset. We will use the train dataset for model development only. The datasets are first loaded into an R session and a beginning inspection is done using the read.csv, dim, names, and str functions:

> housing_train <- read.csv("../Data/Housing/train.csv",
+                           row.names = 1,na.strings = "NA",
+  ...