The preparations
You will find the code for this example here: https://github.com/PacktPublishing/Interpretable-Machine-Learning-with-Python/blob/master/Chapter03/FlightDelays.ipynb.
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),rulefit
,cvae
,statsmodels
,interpret
, andskope-rules
to fit models and calculate performance metricsmatplotlib
andseaborn
to create visualizations
Load these libraries as seen in the following snippet:
import math import mldatasets import pandas as pd import numpy as np from sklearn.pipeline import make_pipeline from sklearn.preprocessing import PolynomialFeatures, StandardScaler from sklearn.model_selection import train_test_split from sklearn import metrics, linear_model, tree, naive_bayes,\ neighbors, ensemble, neural_network, svm, decomposition, manifold from rulefit import...