Skip to Main Content
Ensemble Machine Learning Cookbook
book

Ensemble Machine Learning Cookbook

by Dipayan Sarkar, Vijayalakshmi Natarajan
January 2019
Beginner to intermediate content levelBeginner to intermediate
336 pages
7h 58m
English
Packt Publishing
Content preview from Ensemble Machine Learning Cookbook

How to do it...

Let's move on to building our model. We will start by identifying our numerical and categorical variables. We study the correlations using the correlation matrix and the correlation plots.

  1. First, we'll take a look at the variables and the variable types:
# See the variables and their data typesdf_housingdata.dtypes
  1. We'll then look at the correlation matrix. The corr() method computes the pairwise correlation of columns:
# We pass 'pearson' as the method for calculating our correlationdf_housingdata.corr(method='pearson')
  1. Besides this, we'd also like to study the correlation between the predictor variables and the response variable:
# we store the correlation matrix output in a variablepearson = df_housingdata.corr(method='pearson') ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Productive and Efficient Data Science with Python: With Modularizing, Memory profiles, and Parallel/GPU Processing

Productive and Efficient Data Science with Python: With Modularizing, Memory profiles, and Parallel/GPU Processing

Tirthajyoti Sarkar
Hands-On Automated Machine Learning

Hands-On Automated Machine Learning

Sibanjan Das, Umit Mert Cakmak

Publisher Resources

ISBN: 9781789136609Supplemental Content