Preparations
You will find most of the code for this example here: https://github.com/PacktPublishing/Interpretable-Machine-Learning-with-Python/blob/master/Chapter08/FruitClassifier_part1.ipynb, up to the Exploring Classifications with Pertubation-Based Attribution Methods section. That section alone is located here: https://github.com/PacktPublishing/Interpretable-Machine-Learning-with-Python/blob/master/Chapter08/FruitClassifier_part2.ipynb.
Loading the libraries
To run this example, you need to install the following libraries:
mldatasets
to load the datasetpandas
,numpy
, andsklearn
(Scikit-learn) to manipulate ittensorflow
to fit and predict with the modelsmatplotlib
,seaborn
,cv2
,skimage
,tf-explain
,tf-keras-vis
,lime
,alibi
, andshap
to visualize the interpretations
You should load all of them first:
import math import os import mldatasets import pandas as pd import numpy as np from sklearn import preprocessing, metrics import tensorflow...