Getting started with LIME
In this section, we will install LIME using LIME.ipynb
, a Jupyter Notebook on Google Colaboratory. We will then retrieve the 20 newsgroups dataset from sklearn.datasets
.
We will read the dataset and vectorize it.
The process is a standard scikit-learn approach that you can save and use as a template for other projects in which you implement other scikit-learn models.
We have already used this process in Chapter 4, Microsoft Azure Machine Learning Model Interpretability with SHAP. In this chapter, we will not examine the dataset from an ethical perspective. I chose one with no ethical ambiguity.
We will directly install LIME, then import and vectorize the dataset.
Let's now start by installing LIME on Google Colaboratory.
Installing LIME on Google Colaboratory
Open LIME.ipynb
. We will be using LIME.ipynb
throughout this chapter. The first cell contains the installation command:
# @title Installing LIME
try:
import...