Ensemble Machine Learning Cookbook
上QQ阅读APP看书,第一时间看更新

Getting ready

In the following steps we will download the following packages:

To start with, import the os and pandas packages and set your working directory according to your requirements:

# import required packages
import os
import pandas as pd

# Set working directory as per your need
os.chdir(".../.../Chapter 2")
os.getcwd()

Download the Cryotherapy.csv dataset from GitHub and copy it to your working directory. Read the dataset:

df_cryotherapydata = pd.read_csv("Cryotherapy.csv")

Take a look at the data with the following code:

df_cryotherapydata.head(5)

We can see that the data has been read properly and has the Result_of_Treatment class variable. We then move on to creating models with Result_of_Treatment as the response variable.