The preparations
You will find the code for this example here: https://github.com/PacktPublishing/Interpretable-Machine-Learning-with-Python/tree/master/Chapter10/Mailer.ipynb.
Loading the libraries
To run this example, you need to install the following libraries:
mldatasets
to load the datasetpandas
,numpy
, andscipy
to manipulate itmlxtend
,sklearn_genetic
,xgboost
, andsklearn
(scikit-learn) to fit the modelsmatplotlib
andseaborn
to create and visualize the interpretations
To load the libraries, use the following code block:
import math
import os
import mldatasets
import pandas as pd
import numpy as np
import timeit
from tqdm.notebook import tqdm
from sklearn.feature_selection import VarianceThreshold,\
mutual_info_classif, SelectKBest
from sklearn.feature_selection import SelectFromModel
from sklearn.linear_model import LogisticRegression,\
LassoCV, LassoLarsCV, LassoLarsIC
from mlxtend.feature_selection...