The preparations
You will find the code for this example here:
Loading the libraries
To run this example, you need to install the following libraries:
mldatasets
to load the datasetpandas
andnumpy
to manipulate itsklearn
(scikit-learn) to split the data and fit the modelsmatplotlib
andpdpbox
to visualize the interpretations
You should load all of them first, using the following code:
import math import mldatasets import pandas as pd import numpy as np from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from sklearn import metrics, linear_model, tree,\ discriminant_analysis, ensemble, neural_network, inspection import matplotlib.pyplot as plt from pdpbox import pdp
Now, we can continue...