In this section, you are going to learn how to use the scikit-learn package in Python to build decision tree models and interpret the results via visualizations using Python's graphviz package. For those readers that would like to use R instead of Python for this exercise, you can skip to the next section. We will start this section by analyzing the bank marketing dataset in depth, using the pandas and matplotlib packages, and then we will discuss how to build and interpret decision tree models.
For this exercise, we will be using one of the publicly available datasets from the UCI Machine Learning Repository, which can be found at https://archive.ics.uci.edu/ml/datasets/bank+marketing. You can follow the link and download the data in ZIP format. We will use the bank.zip file for this exercise. When you unzip this file, you will...