```python
!pip install --upgrade pandas numpy scikit-learn tensorflow matplotlib seaborn

```

    Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (1.3.5)
    Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (1.21.5)
    Requirement already satisfied: scikit-learn in /usr/local/lib/python3.7/dist-packages (1.0.2)
    Requirement already satisfied: tensorflow in /usr/local/lib/python3.7/dist-packages (2.8.0)
    Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (3.2.2)
    Collecting matplotlib
      Downloading matplotlib-3.5.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (11.2 MB)
         |████████████████████████████████| 11.2 MB 9.5 MB/s
    Requirement already satisfied: seaborn in /usr/local/lib/python3.7/dist-packages (0.11.2)
    Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas) (2.8.2)
    Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas) (2018.9)
    Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.7.3->pandas) (1.15.0)
    Requirement already satisfied: scipy>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn) (1.4.1)
    Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn) (1.1.0)
    Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn) (3.1.0)
    Requirement already satisfied: h5py>=2.9.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (3.1.0)
    Requirement already satisfied: keras<2.9,>=2.8.0rc0 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (2.8.0)
    Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (1.1.0)
    Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from tensorflow) (57.4.0)
    Requirement already satisfied: google-pasta>=0.1.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (0.2.0)
    Requirement already satisfied: flatbuffers>=1.12 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (2.0)
    Requirement already satisfied: typing-extensions>=3.6.6 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (3.10.0.2)
    Requirement already satisfied: astunparse>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (1.6.3)
    Collecting tf-estimator-nightly==2.8.0.dev2021122109
      Downloading tf_estimator_nightly-2.8.0.dev2021122109-py2.py3-none-any.whl (462 kB)
         |████████████████████████████████| 462 kB 61.8 MB/s
    Requirement already satisfied: gast>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (0.5.3)
    Requirement already satisfied: wrapt>=1.11.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (1.14.0)
    Requirement already satisfied: protobuf>=3.9.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (3.17.3)
    Requirement already satisfied: absl-py>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (1.0.0)
    Requirement already satisfied: grpcio<2.0,>=1.24.3 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (1.44.0)
    Requirement already satisfied: tensorflow-io-gcs-filesystem>=0.23.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (0.24.0)
    Requirement already satisfied: libclang>=9.0.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (13.0.0)
    Requirement already satisfied: opt-einsum>=2.3.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (3.3.0)
    Requirement already satisfied: tensorboard<2.9,>=2.8 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (2.8.0)
    Requirement already satisfied: keras-preprocessing>=1.1.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (1.1.2)
    Requirement already satisfied: wheel<1.0,>=0.23.0 in /usr/local/lib/python3.7/dist-packages (from astunparse>=1.6.0->tensorflow) (0.37.1)
    Requirement already satisfied: cached-property in /usr/local/lib/python3.7/dist-packages (from h5py>=2.9.0->tensorflow) (1.5.2)
    Requirement already satisfied: requests<3,>=2.21.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow) (2.23.0)
    Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow) (1.35.0)
    Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow) (1.8.1)
    Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow) (0.6.1)
    Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow) (1.0.1)
    Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow) (3.3.6)
    Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.9,>=2.8->tensorflow) (0.4.6)
    Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard<2.9,>=2.8->tensorflow) (4.8)
    Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard<2.9,>=2.8->tensorflow) (4.2.4)
    Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard<2.9,>=2.8->tensorflow) (0.2.8)
    Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.7/dist-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.9,>=2.8->tensorflow) (1.3.1)
    Requirement already satisfied: importlib-metadata>=4.4 in /usr/local/lib/python3.7/dist-packages (from markdown>=2.6.8->tensorboard<2.9,>=2.8->tensorflow) (4.11.3)
    Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<2.9,>=2.8->tensorflow) (3.7.0)
    Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /usr/local/lib/python3.7/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard<2.9,>=2.8->tensorflow) (0.4.8)
    Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.21.0->tensorboard<2.9,>=2.8->tensorflow) (3.0.4)
    Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.21.0->tensorboard<2.9,>=2.8->tensorflow) (2021.10.8)
    Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.21.0->tensorboard<2.9,>=2.8->tensorflow) (1.24.3)
    Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.21.0->tensorboard<2.9,>=2.8->tensorflow) (2.10)
    Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.9,>=2.8->tensorflow) (3.2.0)
    Requirement already satisfied: pyparsing>=2.2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib) (3.0.7)
    Collecting fonttools>=4.22.0
      Downloading fonttools-4.31.2-py3-none-any.whl (899 kB)
         |████████████████████████████████| 899 kB 42.9 MB/s
    Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib) (1.4.0)
    Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib) (0.11.0)
    Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib) (21.3)
    Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib) (7.1.2)
    Installing collected packages: fonttools, tf-estimator-nightly, matplotlib
      Attempting uninstall: matplotlib
        Found existing installation: matplotlib 3.2.2
        Uninstalling matplotlib-3.2.2:
          Successfully uninstalled matplotlib-3.2.2
    ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    albumentations 0.1.12 requires imgaug<0.2.7,>=0.2.5, but you have imgaug 0.2.9 which is incompatible.
    Successfully installed fonttools-4.31.2 matplotlib-3.5.1 tf-estimator-nightly-2.8.0.dev2021122109

```python
!pip install --upgrade machine-learning-datasets
!pip install --upgrade catboost alibi shap witwidget
```

    Collecting machine-learning-datasets
      Downloading machine_learning_datasets-0.1.16.4-py3-none-any.whl (25 kB)
    Collecting opencv-python<5.0.0,>=4.5.1
      Downloading opencv_python-4.5.5.64-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (60.5 MB)
         |████████████████████████████████| 60.5 MB 56 kB/s
    Requirement already satisfied: matplotlib<4.0.0,>=3.2.2 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (3.5.1)
    Requirement already satisfied: scipy<2.0.0,>=1.4.1 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (1.4.1)
    Requirement already satisfied: mlxtend<0.15.0,>=0.14.0 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (0.14.0)
    Requirement already satisfied: tqdm<5.0.0,>=4.41.1 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (4.63.0)
    Requirement already satisfied: statsmodels<0.11.0,>=0.10.2 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (0.10.2)
    Collecting scikit-learn<0.23.0,>=0.22.2.post1
      Downloading scikit_learn-0.22.2.post1-cp37-cp37m-manylinux1_x86_64.whl (7.1 MB)
         |████████████████████████████████| 7.1 MB 25.1 MB/s
    Collecting aif360<0.4.0,>=0.3.0
      Downloading aif360-0.3.0-py3-none-any.whl (165 kB)
         |████████████████████████████████| 165 kB 55.9 MB/s
    Collecting pathlib2<3.0.0,>=2.3.5
      Downloading pathlib2-2.3.7.post1-py2.py3-none-any.whl (18 kB)
    Requirement already satisfied: numpy<2.0.0,>=1.19.5 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (1.21.5)
    Requirement already satisfied: pandas<2.0.0,>=1.1.5 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (1.3.5)
    Collecting alibi<0.6.0,>=0.5.5
      Downloading alibi-0.5.8-py3-none-any.whl (312 kB)
         |████████████████████████████████| 312 kB 5.5 MB/s
    Collecting pycebox<0.0.2,>=0.0.1
      Downloading pycebox-0.0.1.tar.gz (4.5 kB)
    Requirement already satisfied: seaborn<0.12.0,>=0.11.1 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (0.11.2)
    Requirement already satisfied: requests<3.0.0,>=2.21.0 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.23.0)
    Requirement already satisfied: dill<0.4.0,>=0.3.0 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.3.4)
    Collecting attrs<21.0.0,>=19.2.0
      Downloading attrs-20.3.0-py2.py3-none-any.whl (49 kB)
         |████████████████████████████████| 49 kB 4.3 MB/s
    Requirement already satisfied: scikit-image!=0.17.1,<0.19,>=0.14.2 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.18.3)
    Collecting tensorflow<2.5.0,>=2.0.0
      Downloading tensorflow-2.4.4-cp37-cp37m-manylinux2010_x86_64.whl (394.5 MB)
         |████████████████████████████████| 394.5 MB 37 kB/s
    Requirement already satisfied: spacy[lookups]<4.0.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.2.4)
    Requirement already satisfied: Pillow<9.0,>=5.4.1 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (7.1.2)
    Requirement already satisfied: typing-extensions>=3.7.2 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.10.0.2)
    Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib<4.0.0,>=3.2.2->machine-learning-datasets) (21.3)
    Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib<4.0.0,>=3.2.2->machine-learning-datasets) (0.11.0)
    Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib<4.0.0,>=3.2.2->machine-learning-datasets) (4.31.2)
    Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib<4.0.0,>=3.2.2->machine-learning-datasets) (1.4.0)
    Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.7/dist-packages (from matplotlib<4.0.0,>=3.2.2->machine-learning-datasets) (2.8.2)
    Requirement already satisfied: pyparsing>=2.2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib<4.0.0,>=3.2.2->machine-learning-datasets) (3.0.7)
    Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from mlxtend<0.15.0,>=0.14.0->machine-learning-datasets) (57.4.0)
    Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas<2.0.0,>=1.1.5->machine-learning-datasets) (2018.9)
    Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from pathlib2<3.0.0,>=2.3.5->machine-learning-datasets) (1.15.0)
    Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.21.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.24.3)
    Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.21.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.0.4)
    Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.21.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2021.10.8)
    Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.21.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.10)
    Requirement already satisfied: networkx>=2.0 in /usr/local/lib/python3.7/dist-packages (from scikit-image!=0.17.1,<0.19,>=0.14.2->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.6.3)
    Requirement already satisfied: imageio>=2.3.0 in /usr/local/lib/python3.7/dist-packages (from scikit-image!=0.17.1,<0.19,>=0.14.2->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.4.1)
    Requirement already satisfied: tifffile>=2019.7.26 in /usr/local/lib/python3.7/dist-packages (from scikit-image!=0.17.1,<0.19,>=0.14.2->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2021.11.2)
    Requirement already satisfied: PyWavelets>=1.1.1 in /usr/local/lib/python3.7/dist-packages (from scikit-image!=0.17.1,<0.19,>=0.14.2->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.3.0)
    Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn<0.23.0,>=0.22.2.post1->machine-learning-datasets) (1.1.0)
    Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.0.6)
    Requirement already satisfied: plac<1.2.0,>=0.9.6 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.1.3)
    Requirement already satisfied: blis<0.5.0,>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.4.1)
    Requirement already satisfied: catalogue<1.1.0,>=0.0.7 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.0.0)
    Requirement already satisfied: wasabi<1.1.0,>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.9.0)
    Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.0.6)
    Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.0.6)
    Requirement already satisfied: thinc==7.4.0 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (7.4.0)
    Requirement already satisfied: srsly<1.1.0,>=1.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.0.5)
    Collecting spacy-lookups-data<0.2.0,>=0.0.5
      Downloading spacy_lookups_data-0.1.0.tar.gz (28.0 MB)
         |████████████████████████████████| 28.0 MB 1.2 MB/s
    Requirement already satisfied: importlib-metadata>=0.20 in /usr/local/lib/python3.7/dist-packages (from catalogue<1.1.0,>=0.0.7->spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (4.11.3)
    Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata>=0.20->catalogue<1.1.0,>=0.0.7->spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.7.0)
    Requirement already satisfied: patsy>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from statsmodels<0.11.0,>=0.10.2->machine-learning-datasets) (0.5.2)
    Collecting absl-py~=0.10
      Downloading absl_py-0.15.0-py3-none-any.whl (132 kB)
         |████████████████████████████████| 132 kB 30.9 MB/s
    Requirement already satisfied: astunparse~=1.6.3 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.6.3)
    Collecting flatbuffers~=1.12.0
      Downloading flatbuffers-1.12-py2.py3-none-any.whl (15 kB)
    Requirement already satisfied: wheel~=0.35 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.37.1)
    Requirement already satisfied: tensorboard~=2.4 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.8.0)
    Collecting grpcio~=1.32.0
      Downloading grpcio-1.32.0-cp37-cp37m-manylinux2014_x86_64.whl (3.8 MB)
         |████████████████████████████████| 3.8 MB 42.5 MB/s
    Requirement already satisfied: keras-preprocessing~=1.1.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.1.2)
    Requirement already satisfied: opt-einsum~=3.3.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.3.0)
    Requirement already satisfied: protobuf>=3.9.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.17.3)
    Collecting typing-extensions>=3.7.2
      Downloading typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
    Collecting tensorflow-estimator<2.5.0,>=2.4.0
      Downloading tensorflow_estimator-2.4.0-py2.py3-none-any.whl (462 kB)
         |████████████████████████████████| 462 kB 58.0 MB/s
    Requirement already satisfied: termcolor~=1.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.1.0)
    Requirement already satisfied: google-pasta~=0.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.2.0)
    Collecting gast==0.3.3
      Downloading gast-0.3.3-py2.py3-none-any.whl (9.7 kB)
    Collecting h5py~=2.10.0
      Downloading h5py-2.10.0-cp37-cp37m-manylinux1_x86_64.whl (2.9 MB)
         |████████████████████████████████| 2.9 MB 47.5 MB/s
    Collecting numpy<2.0.0,>=1.19.5
      Downloading numpy-1.19.5-cp37-cp37m-manylinux2010_x86_64.whl (14.8 MB)
         |████████████████████████████████| 14.8 MB 35.0 MB/s
    Collecting wrapt~=1.12.1
      Downloading wrapt-1.12.1.tar.gz (27 kB)
    Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.35.0)
    Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.4.6)
    Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.0.1)
    Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.6.1)
    Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.3.6)
    Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.8.1)
    Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.2.8)
    Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (4.2.4)
    Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (4.8)
    Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.7/dist-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.3.1)
    Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /usr/local/lib/python3.7/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.4.8)
    Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.2.0)
    Building wheels for collected packages: pycebox, spacy-lookups-data, wrapt
      Building wheel for pycebox (setup.py) ... done
      Created wheel for pycebox: filename=pycebox-0.0.1-py3-none-any.whl size=3640 sha256=c9318e54833f428e28867a3604914d847b1f757885d8f3535d62f65ff12bf43e
      Stored in directory: /root/.cache/pip/wheels/cc/0d/0a/06236a41d8f5c3485c1057262de55329e227a0c239fd00d0cd
      Building wheel for spacy-lookups-data (setup.py) ... done
      Created wheel for spacy-lookups-data: filename=spacy_lookups_data-0.1.0-py2.py3-none-any.whl size=28052158 sha256=660507c1e2d90d6d7412fbc92ff0fffc3ab29b2543126c3d4586ed31c6413590
      Stored in directory: /root/.cache/pip/wheels/b6/09/83/36dd0224ce32dcdf5e218b36362235ca2e50cece60a966ae1b
      Building wheel for wrapt (setup.py) ... done
      Created wheel for wrapt: filename=wrapt-1.12.1-cp37-cp37m-linux_x86_64.whl size=68723 sha256=36440031dce47f588be56cd040a589617624166724f3e812dc4e8e334b12780c
      Stored in directory: /root/.cache/pip/wheels/62/76/4c/aa25851149f3f6d9785f6c869387ad82b3fd37582fa8147ac6
    Successfully built pycebox spacy-lookups-data wrapt
    Installing collected packages: typing-extensions, numpy, grpcio, absl-py, wrapt, tensorflow-estimator, spacy-lookups-data, h5py, gast, flatbuffers, tensorflow, scikit-learn, attrs, pycebox, pathlib2, opencv-python, alibi, aif360, machine-learning-datasets
      Attempting uninstall: typing-extensions
        Found existing installation: typing-extensions 3.10.0.2
        Uninstalling typing-extensions-3.10.0.2:
          Successfully uninstalled typing-extensions-3.10.0.2
      Attempting uninstall: numpy
        Found existing installation: numpy 1.21.5
        Uninstalling numpy-1.21.5:
          Successfully uninstalled numpy-1.21.5
      Attempting uninstall: grpcio
        Found existing installation: grpcio 1.44.0
        Uninstalling grpcio-1.44.0:
          Successfully uninstalled grpcio-1.44.0
      Attempting uninstall: absl-py
        Found existing installation: absl-py 1.0.0
        Uninstalling absl-py-1.0.0:
          Successfully uninstalled absl-py-1.0.0
      Attempting uninstall: wrapt
        Found existing installation: wrapt 1.14.0
        Uninstalling wrapt-1.14.0:
          Successfully uninstalled wrapt-1.14.0
      Attempting uninstall: tensorflow-estimator
        Found existing installation: tensorflow-estimator 2.8.0
        Uninstalling tensorflow-estimator-2.8.0:
          Successfully uninstalled tensorflow-estimator-2.8.0
      Attempting uninstall: h5py
        Found existing installation: h5py 3.1.0
        Uninstalling h5py-3.1.0:
          Successfully uninstalled h5py-3.1.0
      Attempting uninstall: gast
        Found existing installation: gast 0.5.3
        Uninstalling gast-0.5.3:
          Successfully uninstalled gast-0.5.3
      Attempting uninstall: flatbuffers
        Found existing installation: flatbuffers 2.0
        Uninstalling flatbuffers-2.0:
          Successfully uninstalled flatbuffers-2.0
      Attempting uninstall: tensorflow
        Found existing installation: tensorflow 2.8.0
        Uninstalling tensorflow-2.8.0:
          Successfully uninstalled tensorflow-2.8.0
      Attempting uninstall: scikit-learn
        Found existing installation: scikit-learn 1.0.2
        Uninstalling scikit-learn-1.0.2:
          Successfully uninstalled scikit-learn-1.0.2
      Attempting uninstall: attrs
        Found existing installation: attrs 21.4.0
        Uninstalling attrs-21.4.0:
          Successfully uninstalled attrs-21.4.0
      Attempting uninstall: opencv-python
        Found existing installation: opencv-python 4.1.2.30
        Uninstalling opencv-python-4.1.2.30:
          Successfully uninstalled opencv-python-4.1.2.30
    ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    yellowbrick 1.4 requires scikit-learn>=1.0.0, but you have scikit-learn 0.22.2.post1 which is incompatible.
    imbalanced-learn 0.8.1 requires scikit-learn>=0.24, but you have scikit-learn 0.22.2.post1 which is incompatible.
    datascience 0.10.6 requires folium==0.2.1, but you have folium 0.8.3 which is incompatible.
    albumentations 0.1.12 requires imgaug<0.2.7,>=0.2.5, but you have imgaug 0.2.9 which is incompatible.
    Successfully installed absl-py-0.15.0 aif360-0.3.0 alibi-0.5.8 attrs-20.3.0 flatbuffers-1.12 gast-0.3.3 grpcio-1.32.0 h5py-2.10.0 machine-learning-datasets-0.1.16.4 numpy-1.19.5 opencv-python-4.5.5.64 pathlib2-2.3.7.post1 pycebox-0.0.1 scikit-learn-0.22.2.post1 spacy-lookups-data-0.1.0 tensorflow-2.4.4 tensorflow-estimator-2.4.0 typing-extensions-3.7.4.3 wrapt-1.12.1

    Collecting catboost
      Downloading catboost-1.0.4-cp37-none-manylinux1_x86_64.whl (76.1 MB)
         |████████████████████████████████| 76.1 MB 55 kB/s
    Requirement already satisfied: alibi in /usr/local/lib/python3.7/dist-packages (0.5.8)
    Collecting alibi
      Downloading alibi-0.6.5-py3-none-any.whl (398 kB)
         |████████████████████████████████| 398 kB 45.9 MB/s
    Collecting shap
      Downloading shap-0.40.0-cp37-cp37m-manylinux2010_x86_64.whl (564 kB)
         |████████████████████████████████| 564 kB 46.3 MB/s
    Collecting witwidget
      Downloading witwidget-1.8.1-py3-none-any.whl (1.5 MB)
         |████████████████████████████████| 1.5 MB 41.3 MB/s
    Requirement already satisfied: plotly in /usr/local/lib/python3.7/dist-packages (from catboost) (5.5.0)
    Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from catboost) (1.15.0)
    Requirement already satisfied: scipy in /usr/local/lib/python3.7/dist-packages (from catboost) (1.4.1)
    Requirement already satisfied: pandas>=0.24.0 in /usr/local/lib/python3.7/dist-packages (from catboost) (1.3.5)
    Requirement already satisfied: graphviz in /usr/local/lib/python3.7/dist-packages (from catboost) (0.10.1)
    Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from catboost) (3.5.1)
    Requirement already satisfied: numpy>=1.16.0 in /usr/local/lib/python3.7/dist-packages (from catboost) (1.19.5)
    Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas>=0.24.0->catboost) (2018.9)
    Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas>=0.24.0->catboost) (2.8.2)
    Requirement already satisfied: attrs<22.0.0,>=19.2.0 in /usr/local/lib/python3.7/dist-packages (from alibi) (20.3.0)
    Requirement already satisfied: dill<0.4.0,>=0.3.0 in /usr/local/lib/python3.7/dist-packages (from alibi) (0.3.4)
    Requirement already satisfied: Pillow<10.0,>=5.4.1 in /usr/local/lib/python3.7/dist-packages (from alibi) (7.1.2)
    Collecting transformers<5.0.0,>=4.7.0
      Downloading transformers-4.17.0-py3-none-any.whl (3.8 MB)
         |████████████████████████████████| 3.8 MB 39.7 MB/s
    Requirement already satisfied: scikit-image!=0.17.1,<0.20,>=0.14.2 in /usr/local/lib/python3.7/dist-packages (from alibi) (0.18.3)
    Requirement already satisfied: scikit-learn<1.1.0,>=0.20.2 in /usr/local/lib/python3.7/dist-packages (from alibi) (0.22.2.post1)
    Requirement already satisfied: requests<3.0.0,>=2.21.0 in /usr/local/lib/python3.7/dist-packages (from alibi) (2.23.0)
    Requirement already satisfied: spacy[lookups]<4.0.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from alibi) (2.2.4)
    Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.7/dist-packages (from alibi) (3.7.4.3)
    Requirement already satisfied: tqdm<5.0.0,>=4.28.1 in /usr/local/lib/python3.7/dist-packages (from alibi) (4.63.0)
    Requirement already satisfied: tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from alibi) (2.4.4)
    Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->catboost) (0.11.0)
    Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib->catboost) (4.31.2)
    Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->catboost) (1.4.0)
    Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib->catboost) (21.3)
    Requirement already satisfied: pyparsing>=2.2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->catboost) (3.0.7)
    Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.21.0->alibi) (1.24.3)
    Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.21.0->alibi) (2021.10.8)
    Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.21.0->alibi) (2.10)
    Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.21.0->alibi) (3.0.4)
    Requirement already satisfied: networkx>=2.0 in /usr/local/lib/python3.7/dist-packages (from scikit-image!=0.17.1,<0.20,>=0.14.2->alibi) (2.6.3)
    Requirement already satisfied: PyWavelets>=1.1.1 in /usr/local/lib/python3.7/dist-packages (from scikit-image!=0.17.1,<0.20,>=0.14.2->alibi) (1.3.0)
    Requirement already satisfied: tifffile>=2019.7.26 in /usr/local/lib/python3.7/dist-packages (from scikit-image!=0.17.1,<0.20,>=0.14.2->alibi) (2021.11.2)
    Requirement already satisfied: imageio>=2.3.0 in /usr/local/lib/python3.7/dist-packages (from scikit-image!=0.17.1,<0.20,>=0.14.2->alibi) (2.4.1)
    Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn<1.1.0,>=0.20.2->alibi) (1.1.0)
    Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi) (2.0.6)
    Requirement already satisfied: srsly<1.1.0,>=1.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi) (1.0.5)
    Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi) (57.4.0)
    Requirement already satisfied: blis<0.5.0,>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi) (0.4.1)
    Requirement already satisfied: wasabi<1.1.0,>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi) (0.9.0)
    Requirement already satisfied: plac<1.2.0,>=0.9.6 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi) (1.1.3)
    Requirement already satisfied: catalogue<1.1.0,>=0.0.7 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi) (1.0.0)
    Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi) (1.0.6)
    Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi) (3.0.6)
    Requirement already satisfied: thinc==7.4.0 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi) (7.4.0)
    Requirement already satisfied: spacy-lookups-data<0.2.0,>=0.0.5 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi) (0.1.0)
    Requirement already satisfied: importlib-metadata>=0.20 in /usr/local/lib/python3.7/dist-packages (from catalogue<1.1.0,>=0.0.7->spacy[lookups]<4.0.0,>=2.0.0->alibi) (4.11.3)
    Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata>=0.20->catalogue<1.1.0,>=0.0.7->spacy[lookups]<4.0.0,>=2.0.0->alibi) (3.7.0)
    Requirement already satisfied: tensorboard~=2.4 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (2.8.0)
    Requirement already satisfied: keras-preprocessing~=1.1.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (1.1.2)
    Requirement already satisfied: wheel~=0.35 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (0.37.1)
    Requirement already satisfied: wrapt~=1.12.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (1.12.1)
    Requirement already satisfied: gast==0.3.3 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (0.3.3)
    Requirement already satisfied: opt-einsum~=3.3.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (3.3.0)
    Requirement already satisfied: tensorflow-estimator<2.5.0,>=2.4.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (2.4.0)
    Requirement already satisfied: protobuf>=3.9.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (3.17.3)
    Requirement already satisfied: absl-py~=0.10 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (0.15.0)
    Requirement already satisfied: google-pasta~=0.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (0.2.0)
    Requirement already satisfied: grpcio~=1.32.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (1.32.0)
    Requirement already satisfied: h5py~=2.10.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (2.10.0)
    Requirement already satisfied: flatbuffers~=1.12.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (1.12)
    Requirement already satisfied: termcolor~=1.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (1.1.0)
    Requirement already satisfied: astunparse~=1.6.3 in /usr/local/lib/python3.7/dist-packages (from tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (1.6.3)
    Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (1.8.1)
    Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (3.3.6)
    Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (1.0.1)
    Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (0.6.1)
    Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (0.4.6)
    Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (1.35.0)
    Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard~=2.4->tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (0.2.8)
    Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard~=2.4->tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (4.2.4)
    Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard~=2.4->tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (4.8)
    Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.7/dist-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (1.3.1)
    Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /usr/local/lib/python3.7/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard~=2.4->tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (0.4.8)
    Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow!=2.6.0,!=2.6.1,<2.9.0,>=2.0.0->alibi) (3.2.0)
    Requirement already satisfied: filelock in /usr/local/lib/python3.7/dist-packages (from transformers<5.0.0,>=4.7.0->alibi) (3.6.0)
    Collecting huggingface-hub<1.0,>=0.1.0
      Downloading huggingface_hub-0.4.0-py3-none-any.whl (67 kB)
         |████████████████████████████████| 67 kB 4.7 MB/s
    Collecting sacremoses
      Downloading sacremoses-0.0.49-py3-none-any.whl (895 kB)
         |████████████████████████████████| 895 kB 46.6 MB/s
    Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.7/dist-packages (from transformers<5.0.0,>=4.7.0->alibi) (2019.12.20)
    Collecting tokenizers!=0.11.3,>=0.11.1
      Downloading tokenizers-0.11.6-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (6.5 MB)
         |████████████████████████████████| 6.5 MB 43.8 MB/s
    Collecting pyyaml>=5.1
      Downloading PyYAML-6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (596 kB)
         |████████████████████████████████| 596 kB 53.8 MB/s
    Collecting slicer==0.0.7
      Downloading slicer-0.0.7-py3-none-any.whl (14 kB)
    Requirement already satisfied: numba in /usr/local/lib/python3.7/dist-packages (from shap) (0.51.2)
    Requirement already satisfied: cloudpickle in /usr/local/lib/python3.7/dist-packages (from shap) (1.3.0)
    Requirement already satisfied: ipywidgets>=7.0.0 in /usr/local/lib/python3.7/dist-packages (from witwidget) (7.7.0)
    Requirement already satisfied: google-api-python-client>=1.7.8 in /usr/local/lib/python3.7/dist-packages (from witwidget) (1.12.11)
    Requirement already satisfied: oauth2client>=4.1.3 in /usr/local/lib/python3.7/dist-packages (from witwidget) (4.1.3)
    Requirement already satisfied: google-auth-httplib2>=0.0.3 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.7.8->witwidget) (0.0.4)
    Requirement already satisfied: uritemplate<4dev,>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.7.8->witwidget) (3.0.1)
    Requirement already satisfied: httplib2<1dev,>=0.15.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.7.8->witwidget) (0.17.4)
    Requirement already satisfied: google-api-core<3dev,>=1.21.0 in /usr/local/lib/python3.7/dist-packages (from google-api-python-client>=1.7.8->witwidget) (1.26.3)
    Requirement already satisfied: googleapis-common-protos<2.0dev,>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from google-api-core<3dev,>=1.21.0->google-api-python-client>=1.7.8->witwidget) (1.56.0)
    Requirement already satisfied: ipython-genutils~=0.2.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets>=7.0.0->witwidget) (0.2.0)
    Requirement already satisfied: ipython>=4.0.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets>=7.0.0->witwidget) (5.5.0)
    Requirement already satisfied: nbformat>=4.2.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets>=7.0.0->witwidget) (5.2.0)
    Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets>=7.0.0->witwidget) (1.1.0)
    Requirement already satisfied: traitlets>=4.3.1 in /usr/local/lib/python3.7/dist-packages (from ipywidgets>=7.0.0->witwidget) (5.1.1)
    Requirement already satisfied: ipykernel>=4.5.1 in /usr/local/lib/python3.7/dist-packages (from ipywidgets>=7.0.0->witwidget) (4.10.1)
    Requirement already satisfied: widgetsnbextension~=3.6.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets>=7.0.0->witwidget) (3.6.0)
    Requirement already satisfied: jupyter-client in /usr/local/lib/python3.7/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.0.0->witwidget) (5.3.5)
    Requirement already satisfied: tornado>=4.0 in /usr/local/lib/python3.7/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.0.0->witwidget) (5.1.1)
    Requirement already satisfied: decorator in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets>=7.0.0->witwidget) (4.4.2)
    Requirement already satisfied: pexpect in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets>=7.0.0->witwidget) (4.8.0)
    Requirement already satisfied: pickleshare in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets>=7.0.0->witwidget) (0.7.5)
    Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.4 in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets>=7.0.0->witwidget) (1.0.18)
    Requirement already satisfied: pygments in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets>=7.0.0->witwidget) (2.6.1)
    Requirement already satisfied: simplegeneric>0.8 in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets>=7.0.0->witwidget) (0.8.1)
    Requirement already satisfied: jupyter-core in /usr/local/lib/python3.7/dist-packages (from nbformat>=4.2.0->ipywidgets>=7.0.0->witwidget) (4.9.2)
    Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in /usr/local/lib/python3.7/dist-packages (from nbformat>=4.2.0->ipywidgets>=7.0.0->witwidget) (4.3.3)
    Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets>=7.0.0->witwidget) (0.18.1)
    Requirement already satisfied: importlib-resources>=1.4.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets>=7.0.0->witwidget) (5.4.0)
    Requirement already satisfied: wcwidth in /usr/local/lib/python3.7/dist-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython>=4.0.0->ipywidgets>=7.0.0->witwidget) (0.2.5)
    Requirement already satisfied: notebook>=4.4.1 in /usr/local/lib/python3.7/dist-packages (from widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (5.3.1)
    Requirement already satisfied: Send2Trash in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (1.8.0)
    Requirement already satisfied: terminado>=0.8.1 in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (0.13.3)
    Requirement already satisfied: nbconvert in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (5.6.1)
    Requirement already satisfied: jinja2 in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (2.11.3)
    Requirement already satisfied: pyzmq>=13 in /usr/local/lib/python3.7/dist-packages (from jupyter-client->ipykernel>=4.5.1->ipywidgets>=7.0.0->witwidget) (22.3.0)
    Requirement already satisfied: ptyprocess in /usr/local/lib/python3.7/dist-packages (from terminado>=0.8.1->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (0.7.0)
    Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.7/dist-packages (from jinja2->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (2.0.1)
    Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (1.5.0)
    Requirement already satisfied: bleach in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (4.1.0)
    Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (0.8.4)
    Requirement already satisfied: defusedxml in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (0.7.1)
    Requirement already satisfied: entrypoints>=0.2.2 in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (0.4)
    Requirement already satisfied: testpath in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (0.6.0)
    Requirement already satisfied: webencodings in /usr/local/lib/python3.7/dist-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->witwidget) (0.5.1)
    Requirement already satisfied: llvmlite<0.35,>=0.34.0.dev0 in /usr/local/lib/python3.7/dist-packages (from numba->shap) (0.34.0)
    Requirement already satisfied: tenacity>=6.2.0 in /usr/local/lib/python3.7/dist-packages (from plotly->catboost) (8.0.1)
    Requirement already satisfied: click in /usr/local/lib/python3.7/dist-packages (from sacremoses->transformers<5.0.0,>=4.7.0->alibi) (7.1.2)
    Installing collected packages: pyyaml, tokenizers, sacremoses, huggingface-hub, transformers, slicer, witwidget, shap, catboost, alibi
      Attempting uninstall: pyyaml
        Found existing installation: PyYAML 3.13
        Uninstalling PyYAML-3.13:
          Successfully uninstalled PyYAML-3.13
      Attempting uninstall: alibi
        Found existing installation: alibi 0.5.8
        Uninstalling alibi-0.5.8:
          Successfully uninstalled alibi-0.5.8
    ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    machine-learning-datasets 0.1.16.4 requires alibi<0.6.0,>=0.5.5, but you have alibi 0.6.5 which is incompatible.
    Successfully installed alibi-0.6.5 catboost-1.0.4 huggingface-hub-0.4.0 pyyaml-6.0 sacremoses-0.0.49 shap-0.40.0 slicer-0.0.7 tokenizers-0.11.6 transformers-4.17.0 witwidget-1.8.1

```python
import math
import machine_learning_datasets as mldatasets
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn import metrics
from catboost import CatBoostClassifier
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import matplotlib.pyplot as plt
import seaborn as sns
from alibi.utils.mapping import ohe_to_ord, ord_to_ohe
from alibi.explainers import AnchorTabular
from alibi.explainers import CEM
from alibi.explainers import CounterFactualProto
import shap
import witwidget
from witwidget.notebook.visualization import WitWidget, WitConfigBuilder
```

    pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.

```python
tf.compat.v1.disable_eager_execution()
print('Eager execution enabled: ', tf.executing_eagerly())
```

    Eager execution enabled:  False

```python
tf.compat.v1.disable_eager_execution()
print('Eager execution enabled: ', tf.executing_eagerly())
```

    Eager execution enabled:  False

```python
recidivism_df = mldatasets.load("recidivism-risk", prepare=True)

```

    https://storage.googleapis.com/what-if-tool-resources/computefest2019/cox-violent-parsed_filt.csv downloaded to /content/data/cox-violent-parsed_filt.csv
    1 dataset files found in /content/data folder
    parsing /content/data/cox-violent-parsed_filt.csv

```python
recidivism_df.info()

```

    <class 'pandas.core.frame.DataFrame'>
    Int64Index: 14788 entries, 0 to 18315
    Data columns (total 23 columns):
     #   Column                 Non-Null Count  Dtype
    ---  ------                 --------------  -----
     0   age                    14788 non-null  int8
     1   juv_fel_count          14788 non-null  int8
     2   juv_misd_count         14788 non-null  int8
     3   juv_other_count        14788 non-null  int64
     4   priors_count           14788 non-null  int8
     5   is_recid               14788 non-null  int8
     6   sex_Female             14788 non-null  uint8
     7   sex_Male               14788 non-null  uint8
     8   race_African-American  14788 non-null  uint8
     9   race_Asian             14788 non-null  uint8
     10  race_Caucasian         14788 non-null  uint8
     11  race_Hispanic          14788 non-null  uint8
     12  race_Native American   14788 non-null  uint8
     13  race_Other             14788 non-null  uint8
     14  c_charge_degree_(F1)   14788 non-null  uint8
     15  c_charge_degree_(F2)   14788 non-null  uint8
     16  c_charge_degree_(F3)   14788 non-null  uint8
     17  c_charge_degree_(F7)   14788 non-null  uint8
     18  c_charge_degree_(M1)   14788 non-null  uint8
     19  c_charge_degree_(M2)   14788 non-null  uint8
     20  c_charge_degree_(MO3)  14788 non-null  uint8
     21  c_charge_degree_Other  14788 non-null  uint8
     22  compas_score           14788 non-null  int64
    dtypes: int64(2), int8(5), uint8(16)
    memory usage: 649.9 KB

```python
cf_matrix = metrics.confusion_matrix(recidivism_df.is_recid,\
                                     recidivism_df.compas_score)
plt.figure(figsize=(6, 5))
sns.heatmap(cf_matrix/np.sum(cf_matrix), annot=True,\
            fmt='.2%', cmap='Blues', annot_kws={'size':16})
```

```python
recidivism_c_df = recidivism_df[recidivism_df['race_Caucasian'] == 1]
recidivism_aa_df = recidivism_df[recidivism_df['race_African-American'] == 1]

_ = mldatasets.\
      compare_confusion_matrices(recidivism_c_df.is_recid,
                                 recidivism_c_df.compas_score,\
                                 recidivism_aa_df.is_recid,\
                                 recidivism_aa_df.compas_score,\
                                 'Caucasian', 'African-American', compare_fpr=True)
```

```python
rand = 9
np.random.seed(rand)
tf.random.set_seed(rand)

y = recidivism_df['compas_score']
X = recidivism_df.drop(['compas_score', 'is_recid'], axis=1).copy()
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=rand)
```

```python
orig_plt_params = plt.rcParams
sns.set()
cb_mdl = CatBoostClassifier(iterations=500, learning_rate=0.5, depth=8)
fitted_cb_mdl = cb_mdl.fit(X_train, y_train, verbose=False)
y_train_cb_pred, y_test_cb_prob, y_test_cb_pred =\
        mldatasets.evaluate_class_mdl(fitted_cb_mdl, X_train,\
                                      X_test, y_train, y_test)
```

```python
!pip install --upgrade pandas numpy tqdm scikit-learn lightgbm xgboost networkx pydot matplotlib seaborn

```

    Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (1.3.5)
    Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (1.19.5)
    Collecting numpy
      Downloading numpy-1.21.5-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB)
         |████████████████████████████████| 15.7 MB 7.0 MB/s
    Requirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (4.63.0)
    Requirement already satisfied: scikit-learn in /usr/local/lib/python3.7/dist-packages (0.22.2.post1)
    Collecting scikit-learn
      Downloading scikit_learn-1.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (24.8 MB)
         |████████████████████████████████| 24.8 MB 44.9 MB/s
    Requirement already satisfied: lightgbm in /usr/local/lib/python3.7/dist-packages (2.2.3)
    Collecting lightgbm
      Downloading lightgbm-3.3.2-py3-none-manylinux1_x86_64.whl (2.0 MB)
         |████████████████████████████████| 2.0 MB 35.0 MB/s
    Requirement already satisfied: xgboost in /usr/local/lib/python3.7/dist-packages (0.90)
    Collecting xgboost
      Downloading xgboost-1.5.2-py3-none-manylinux2014_x86_64.whl (173.6 MB)
         |████████████████████████████████| 173.6 MB 6.1 kB/s
    Requirement already satisfied: networkx in /usr/local/lib/python3.7/dist-packages (2.6.3)
    Requirement already satisfied: pydot in /usr/local/lib/python3.7/dist-packages (1.3.0)
    Collecting pydot
      Downloading pydot-1.4.2-py2.py3-none-any.whl (21 kB)
    Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (3.1.3)
    Collecting matplotlib
      Using cached matplotlib-3.5.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (11.2 MB)
    Requirement already satisfied: seaborn in /usr/local/lib/python3.7/dist-packages (0.11.2)
    Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas) (2.8.2)
    Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas) (2018.9)
    Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.7.3->pandas) (1.15.0)
    Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn) (1.1.0)
    Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn) (3.1.0)
    Requirement already satisfied: scipy>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn) (1.4.1)
    Requirement already satisfied: wheel in /usr/local/lib/python3.7/dist-packages (from lightgbm) (0.37.1)
    Requirement already satisfied: pyparsing>=2.1.4 in /usr/local/lib/python3.7/dist-packages (from pydot) (3.0.7)
    Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib) (7.1.2)
    Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib) (1.4.0)
    Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib) (4.31.2)
    Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib) (21.3)
    Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib) (0.11.0)
    Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from kiwisolver>=1.0.1->matplotlib) (3.7.4.3)
    Installing collected packages: numpy, scikit-learn, matplotlib, xgboost, pydot, lightgbm
      Attempting uninstall: numpy
        Found existing installation: numpy 1.19.5
        Uninstalling numpy-1.19.5:
          Successfully uninstalled numpy-1.19.5
      Attempting uninstall: scikit-learn
        Found existing installation: scikit-learn 0.22.2.post1
        Uninstalling scikit-learn-0.22.2.post1:
          Successfully uninstalled scikit-learn-0.22.2.post1
      Attempting uninstall: matplotlib
        Found existing installation: matplotlib 3.1.3
        Uninstalling matplotlib-3.1.3:
          Successfully uninstalled matplotlib-3.1.3
      Attempting uninstall: xgboost
        Found existing installation: xgboost 0.90
        Uninstalling xgboost-0.90:
          Successfully uninstalled xgboost-0.90
      Attempting uninstall: pydot
        Found existing installation: pydot 1.3.0
        Uninstalling pydot-1.3.0:
          Successfully uninstalled pydot-1.3.0
      Attempting uninstall: lightgbm
        Found existing installation: lightgbm 2.2.3
        Uninstalling lightgbm-2.2.3:
          Successfully uninstalled lightgbm-2.2.3
    ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    tensorflow 2.4.4 requires numpy~=1.19.2, but you have numpy 1.21.5 which is incompatible.
    machine-learning-datasets 0.1.16.4 requires alibi<0.6.0,>=0.5.5, but you have alibi 0.6.5 which is incompatible.
    machine-learning-datasets 0.1.16.4 requires scikit-learn<0.23.0,>=0.22.2.post1, but you have scikit-learn 1.0.2 which is incompatible.
    datascience 0.10.6 requires folium==0.2.1, but you have folium 0.8.3 which is incompatible.
    albumentations 0.1.12 requires imgaug<0.2.7,>=0.2.5, but you have imgaug 0.2.9 which is incompatible.
    Successfully installed lightgbm-3.3.2 matplotlib-3.5.1 numpy-1.21.5 pydot-1.4.2 scikit-learn-1.0.2 xgboost-1.5.2

```python
!pip install --upgrade machine-learning-datasets
!pip install --upgrade econml dowhy
!pip install --no-deps git+https://github.com/EthicalML/xai.git
!pip install aif360==0.3.0
!pip install BlackBoxAuditing==0.1.54
```

    Requirement already satisfied: machine-learning-datasets in /usr/local/lib/python3.7/dist-packages (0.1.16.4)
    Requirement already satisfied: numpy<2.0.0,>=1.19.5 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (1.21.5)
    Requirement already satisfied: tqdm<5.0.0,>=4.41.1 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (4.63.0)
    Collecting alibi<0.6.0,>=0.5.5
      Using cached alibi-0.5.8-py3-none-any.whl (312 kB)
    Requirement already satisfied: pycebox<0.0.2,>=0.0.1 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (0.0.1)
    Requirement already satisfied: mlxtend<0.15.0,>=0.14.0 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (0.14.0)
    Requirement already satisfied: matplotlib<4.0.0,>=3.2.2 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (3.5.1)
    Requirement already satisfied: pathlib2<3.0.0,>=2.3.5 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (2.3.7.post1)
    Requirement already satisfied: scipy<2.0.0,>=1.4.1 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (1.4.1)
    Requirement already satisfied: aif360<0.4.0,>=0.3.0 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (0.3.0)
    Requirement already satisfied: opencv-python<5.0.0,>=4.5.1 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (4.5.5.64)
    Requirement already satisfied: seaborn<0.12.0,>=0.11.1 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (0.11.2)
    Requirement already satisfied: statsmodels<0.11.0,>=0.10.2 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (0.10.2)
    Collecting scikit-learn<0.23.0,>=0.22.2.post1
      Using cached scikit_learn-0.22.2.post1-cp37-cp37m-manylinux1_x86_64.whl (7.1 MB)
    Requirement already satisfied: pandas<2.0.0,>=1.1.5 in /usr/local/lib/python3.7/dist-packages (from machine-learning-datasets) (1.3.5)
    Requirement already satisfied: tensorflow<2.5.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.4.4)
    Requirement already satisfied: scikit-image!=0.17.1,<0.19,>=0.14.2 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.18.3)
    Requirement already satisfied: typing-extensions>=3.7.2 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.7.4.3)
    Requirement already satisfied: attrs<21.0.0,>=19.2.0 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (20.3.0)
    Requirement already satisfied: spacy[lookups]<4.0.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.2.4)
    Requirement already satisfied: dill<0.4.0,>=0.3.0 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.3.4)
    Requirement already satisfied: requests<3.0.0,>=2.21.0 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.23.0)
    Requirement already satisfied: Pillow<9.0,>=5.4.1 in /usr/local/lib/python3.7/dist-packages (from alibi<0.6.0,>=0.5.5->machine-learning-datasets) (7.1.2)
    Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib<4.0.0,>=3.2.2->machine-learning-datasets) (1.4.0)
    Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib<4.0.0,>=3.2.2->machine-learning-datasets) (0.11.0)
    Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib<4.0.0,>=3.2.2->machine-learning-datasets) (4.31.2)
    Requirement already satisfied: pyparsing>=2.2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib<4.0.0,>=3.2.2->machine-learning-datasets) (3.0.7)
    Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib<4.0.0,>=3.2.2->machine-learning-datasets) (21.3)
    Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.7/dist-packages (from matplotlib<4.0.0,>=3.2.2->machine-learning-datasets) (2.8.2)
    Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from mlxtend<0.15.0,>=0.14.0->machine-learning-datasets) (57.4.0)
    Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas<2.0.0,>=1.1.5->machine-learning-datasets) (2018.9)
    Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from pathlib2<3.0.0,>=2.3.5->machine-learning-datasets) (1.15.0)
    Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.21.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.0.4)
    Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.21.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.10)
    Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.21.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2021.10.8)
    Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.21.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.24.3)
    Requirement already satisfied: tifffile>=2019.7.26 in /usr/local/lib/python3.7/dist-packages (from scikit-image!=0.17.1,<0.19,>=0.14.2->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2021.11.2)
    Requirement already satisfied: imageio>=2.3.0 in /usr/local/lib/python3.7/dist-packages (from scikit-image!=0.17.1,<0.19,>=0.14.2->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.4.1)
    Requirement already satisfied: PyWavelets>=1.1.1 in /usr/local/lib/python3.7/dist-packages (from scikit-image!=0.17.1,<0.19,>=0.14.2->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.3.0)
    Requirement already satisfied: networkx>=2.0 in /usr/local/lib/python3.7/dist-packages (from scikit-image!=0.17.1,<0.19,>=0.14.2->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.6.3)
    Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn<0.23.0,>=0.22.2.post1->machine-learning-datasets) (1.1.0)
    Requirement already satisfied: thinc==7.4.0 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (7.4.0)
    Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.0.6)
    Requirement already satisfied: srsly<1.1.0,>=1.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.0.5)
    Requirement already satisfied: wasabi<1.1.0,>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.9.0)
    Requirement already satisfied: blis<0.5.0,>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.4.1)
    Requirement already satisfied: catalogue<1.1.0,>=0.0.7 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.0.0)
    Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.0.6)
    Requirement already satisfied: plac<1.2.0,>=0.9.6 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.1.3)
    Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.0.6)
    Requirement already satisfied: spacy-lookups-data<0.2.0,>=0.0.5 in /usr/local/lib/python3.7/dist-packages (from spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.1.0)
    Requirement already satisfied: importlib-metadata>=0.20 in /usr/local/lib/python3.7/dist-packages (from catalogue<1.1.0,>=0.0.7->spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (4.11.3)
    Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata>=0.20->catalogue<1.1.0,>=0.0.7->spacy[lookups]<4.0.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.7.0)
    Requirement already satisfied: patsy>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from statsmodels<0.11.0,>=0.10.2->machine-learning-datasets) (0.5.2)
    Collecting numpy<2.0.0,>=1.19.5
      Using cached numpy-1.19.5-cp37-cp37m-manylinux2010_x86_64.whl (14.8 MB)
    Requirement already satisfied: h5py~=2.10.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.10.0)
    Requirement already satisfied: google-pasta~=0.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.2.0)
    Requirement already satisfied: opt-einsum~=3.3.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.3.0)
    Requirement already satisfied: gast==0.3.3 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.3.3)
    Requirement already satisfied: grpcio~=1.32.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.32.0)
    Requirement already satisfied: tensorboard~=2.4 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.8.0)
    Requirement already satisfied: protobuf>=3.9.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.17.3)
    Requirement already satisfied: termcolor~=1.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.1.0)
    Requirement already satisfied: astunparse~=1.6.3 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.6.3)
    Requirement already satisfied: keras-preprocessing~=1.1.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.1.2)
    Requirement already satisfied: wrapt~=1.12.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.12.1)
    Requirement already satisfied: flatbuffers~=1.12.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.12)
    Requirement already satisfied: absl-py~=0.10 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.15.0)
    Requirement already satisfied: wheel~=0.35 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.37.1)
    Requirement already satisfied: tensorflow-estimator<2.5.0,>=2.4.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (2.4.0)
    Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.6.1)
    Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.35.0)
    Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.0.1)
    Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.8.1)
    Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.3.6)
    Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /usr/local/lib/python3.7/dist-packages (from tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.4.6)
    Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (4.2.4)
    Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (4.8)
    Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from google-auth<3,>=1.6.3->tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.2.8)
    Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.7/dist-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (1.3.1)
    Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /usr/local/lib/python3.7/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (0.4.8)
    Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow<2.5.0,>=2.0.0->alibi<0.6.0,>=0.5.5->machine-learning-datasets) (3.2.0)
    Installing collected packages: numpy, scikit-learn, alibi
      Attempting uninstall: numpy
        Found existing installation: numpy 1.21.5
        Uninstalling numpy-1.21.5:
          Successfully uninstalled numpy-1.21.5
      Attempting uninstall: scikit-learn
        Found existing installation: scikit-learn 1.0.2
        Uninstalling scikit-learn-1.0.2:
          Successfully uninstalled scikit-learn-1.0.2
      Attempting uninstall: alibi
        Found existing installation: alibi 0.6.5
        Uninstalling alibi-0.6.5:
          Successfully uninstalled alibi-0.6.5
    ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    yellowbrick 1.4 requires scikit-learn>=1.0.0, but you have scikit-learn 0.22.2.post1 which is incompatible.
    imbalanced-learn 0.8.1 requires scikit-learn>=0.24, but you have scikit-learn 0.22.2.post1 which is incompatible.
    datascience 0.10.6 requires folium==0.2.1, but you have folium 0.8.3 which is incompatible.
    albumentations 0.1.12 requires imgaug<0.2.7,>=0.2.5, but you have imgaug 0.2.9 which is incompatible.
    Successfully installed alibi-0.5.8 numpy-1.19.5 scikit-learn-0.22.2.post1

    Collecting econml
      Downloading econml-0.13.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB)
         |████████████████████████████████| 3.3 MB 4.1 MB/s
    Collecting dowhy
      Downloading dowhy-0.7.1-py3-none-any.whl (164 kB)
         |████████████████████████████████| 164 kB 39.6 MB/s
    Collecting sparse
      Downloading sparse-0.13.0-py2.py3-none-any.whl (77 kB)
         |████████████████████████████████| 77 kB 3.4 MB/s
    Requirement already satisfied: scikit-learn>0.22.0 in /usr/local/lib/python3.7/dist-packages (from econml) (0.22.2.post1)
    Requirement already satisfied: statsmodels>=0.10 in /usr/local/lib/python3.7/dist-packages (from econml) (0.10.2)
    Collecting shap<0.40.0,>=0.38.1
      Downloading shap-0.39.0.tar.gz (356 kB)
         |████████████████████████████████| 356 kB 15.6 MB/s
    Requirement already satisfied: scipy>1.4.0 in /usr/local/lib/python3.7/dist-packages (from econml) (1.4.1)
    Requirement already satisfied: lightgbm in /usr/local/lib/python3.7/dist-packages (from econml) (3.3.2)
    Requirement already satisfied: joblib>=0.13.0 in /usr/local/lib/python3.7/dist-packages (from econml) (1.1.0)
    Collecting dowhy
      Downloading dowhy-0.6-py3-none-any.whl (123 kB)
         |████████████████████████████████| 123 kB 33.8 MB/s
    Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from econml) (1.3.5)
    Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from econml) (1.19.5)
    Requirement already satisfied: networkx>=2.0 in /usr/local/lib/python3.7/dist-packages (from dowhy) (2.6.3)
    Requirement already satisfied: pydot>=1.4 in /usr/local/lib/python3.7/dist-packages (from dowhy) (1.4.2)
    Requirement already satisfied: sympy>=1.4 in /usr/local/lib/python3.7/dist-packages (from dowhy) (1.7.1)
    Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas->econml) (2018.9)
    Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas->econml) (2.8.2)
    Requirement already satisfied: pyparsing>=2.1.4 in /usr/local/lib/python3.7/dist-packages (from pydot>=1.4->dowhy) (3.0.7)
    Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.7.3->pandas->econml) (1.15.0)
    Requirement already satisfied: tqdm>4.25.0 in /usr/local/lib/python3.7/dist-packages (from shap<0.40.0,>=0.38.1->econml) (4.63.0)
    Requirement already satisfied: slicer==0.0.7 in /usr/local/lib/python3.7/dist-packages (from shap<0.40.0,>=0.38.1->econml) (0.0.7)
    Requirement already satisfied: numba in /usr/local/lib/python3.7/dist-packages (from shap<0.40.0,>=0.38.1->econml) (0.51.2)
    Requirement already satisfied: cloudpickle in /usr/local/lib/python3.7/dist-packages (from shap<0.40.0,>=0.38.1->econml) (1.3.0)
    Requirement already satisfied: patsy>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from statsmodels>=0.10->econml) (0.5.2)
    Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.7/dist-packages (from sympy>=1.4->dowhy) (1.2.1)
    Requirement already satisfied: wheel in /usr/local/lib/python3.7/dist-packages (from lightgbm->econml) (0.37.1)
    Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from numba->shap<0.40.0,>=0.38.1->econml) (57.4.0)
    Requirement already satisfied: llvmlite<0.35,>=0.34.0.dev0 in /usr/local/lib/python3.7/dist-packages (from numba->shap<0.40.0,>=0.38.1->econml) (0.34.0)
    Building wheels for collected packages: shap
      Building wheel for shap (setup.py) ... done
      Created wheel for shap: filename=shap-0.39.0-cp37-cp37m-linux_x86_64.whl size=491650 sha256=04db55ac7b8c329c53bd43f3c2be1df194478e3a581ae985026c5320c12295ca
      Stored in directory: /root/.cache/pip/wheels/ca/25/8f/6ae5df62c32651cd719e972e738a8aaa4a87414c4d2b14c9c0
    Successfully built shap
    Installing collected packages: sparse, shap, dowhy, econml
      Attempting uninstall: shap
        Found existing installation: shap 0.40.0
        Uninstalling shap-0.40.0:
          Successfully uninstalled shap-0.40.0
    Successfully installed dowhy-0.6 econml-0.13.0 shap-0.39.0 sparse-0.13.0

    Collecting git+https://github.com/EthicalML/xai.git
      Cloning https://github.com/EthicalML/xai.git to /tmp/pip-req-build-cyhqogqb
      Running command git clone -q https://github.com/EthicalML/xai.git /tmp/pip-req-build-cyhqogqb
    Building wheels for collected packages: xai
      Building wheel for xai (setup.py) ... done
      Created wheel for xai: filename=xai-0.1.0-py3-none-any.whl size=349032 sha256=93137a30dc1e05e234d8977ba25c94db132727a1af0e5a104dca0a9a63ecdab0
      Stored in directory: /tmp/pip-ephem-wheel-cache-eqkhnfbo/wheels/e9/c9/2c/db30b1608d79231b31dfc0dd5defac87b079ffb9fbee6ded4b
    Successfully built xai
    Installing collected packages: xai
    Successfully installed xai-0.1.0
    Requirement already satisfied: aif360==0.3.0 in /usr/local/lib/python3.7/dist-packages (0.3.0)
    Requirement already satisfied: pandas>=0.24.0 in /usr/local/lib/python3.7/dist-packages (from aif360==0.3.0) (1.3.5)
    Requirement already satisfied: scikit-learn>=0.21 in /usr/local/lib/python3.7/dist-packages (from aif360==0.3.0) (0.22.2.post1)
    Requirement already satisfied: numpy>=1.16 in /usr/local/lib/python3.7/dist-packages (from aif360==0.3.0) (1.19.5)
    Requirement already satisfied: scipy>=1.2.0 in /usr/local/lib/python3.7/dist-packages (from aif360==0.3.0) (1.4.1)
    Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from aif360==0.3.0) (3.5.1)
    Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas>=0.24.0->aif360==0.3.0) (2018.9)
    Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas>=0.24.0->aif360==0.3.0) (2.8.2)
    Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.7.3->pandas>=0.24.0->aif360==0.3.0) (1.15.0)
    Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn>=0.21->aif360==0.3.0) (1.1.0)
    Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib->aif360==0.3.0) (21.3)
    Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->aif360==0.3.0) (1.4.0)
    Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib->aif360==0.3.0) (4.31.2)
    Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->aif360==0.3.0) (0.11.0)
    Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib->aif360==0.3.0) (7.1.2)
    Requirement already satisfied: pyparsing>=2.2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->aif360==0.3.0) (3.0.7)
    Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from kiwisolver>=1.0.1->matplotlib->aif360==0.3.0) (3.7.4.3)
    Collecting BlackBoxAuditing==0.1.54
      Downloading BlackBoxAuditing-0.1.54.tar.gz (2.6 MB)
         |████████████████████████████████| 2.6 MB 7.9 MB/s
    Requirement already satisfied: networkx in /usr/local/lib/python3.7/dist-packages (from BlackBoxAuditing==0.1.54) (2.6.3)
    Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from BlackBoxAuditing==0.1.54) (3.5.1)
    Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from BlackBoxAuditing==0.1.54) (1.3.5)
    Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from BlackBoxAuditing==0.1.54) (1.19.5)
    Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->BlackBoxAuditing==0.1.54) (1.4.0)
    Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib->BlackBoxAuditing==0.1.54) (21.3)
    Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib->BlackBoxAuditing==0.1.54) (4.31.2)
    Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->BlackBoxAuditing==0.1.54) (0.11.0)
    Requirement already satisfied: pyparsing>=2.2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->BlackBoxAuditing==0.1.54) (3.0.7)
    Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.7/dist-packages (from matplotlib->BlackBoxAuditing==0.1.54) (7.1.2)
    Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.7/dist-packages (from matplotlib->BlackBoxAuditing==0.1.54) (2.8.2)
    Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from kiwisolver>=1.0.1->matplotlib->BlackBoxAuditing==0.1.54) (3.7.4.3)
    Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.7->matplotlib->BlackBoxAuditing==0.1.54) (1.15.0)
    Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas->BlackBoxAuditing==0.1.54) (2018.9)
    Building wheels for collected packages: BlackBoxAuditing
      Building wheel for BlackBoxAuditing (setup.py) ... done
      Created wheel for BlackBoxAuditing: filename=BlackBoxAuditing-0.1.54-py2.py3-none-any.whl size=1394770 sha256=cfea6e45c91713998eca7157d15f0ceef1785397aab2b82ad0e15cf43dae4bad
      Stored in directory: /root/.cache/pip/wheels/05/9f/ee/541a74be4cf5dad17430e64d3276370ea7b6a834a76cb4215a
    Successfully built BlackBoxAuditing
    Installing collected packages: BlackBoxAuditing
    Successfully installed BlackBoxAuditing-0.1.54

```python
import math
import os
import warnings
warnings.filterwarnings("ignore")
import machine_learning_datasets as mldatasets
import pandas as pd
import numpy as np
from tqdm.notebook import tqdm

from sklearn import model_selection, tree, metrics
import lightgbm as lgb
import xgboost as xgb

from aif360.datasets import BinaryLabelDataset
from aif360.metrics import BinaryLabelDatasetMetric
from aif360.metrics import ClassificationMetric
from aif360.algorithms.preprocessing import Reweighing
from aif360.algorithms.preprocessing import DisparateImpactRemover
from aif360.algorithms.inprocessing import PrejudiceRemover
from aif360.algorithms.inprocessing import GerryFairClassifier
from aif360.algorithms.postprocessing.calibrated_eq_odds_postprocessing import CalibratedEqOddsPostprocessing
from aif360.algorithms.postprocessing.eq_odds_postprocessing import EqOddsPostprocessing

from econml.dr import LinearDRLearner
import dowhy
from dowhy import CausalModel

import xai
from networkx.drawing.nx_pydot import to_pydot
from IPython.display import Image, display
import matplotlib.pyplot as plt
import seaborn as sns

%matplotlib inline
```

    WARNING:root:No module named 'numba.decorators': LFR will be unavailable. To install, run:
    pip install 'aif360[LFR]'

```python

```

```python
!pip install matplotlib==3.1.3

```

    Collecting matplotlib==3.1.3
      Downloading matplotlib-3.1.3-cp37-cp37m-manylinux1_x86_64.whl (13.1 MB)
         |████████████████████████████████| 13.1 MB 6.2 MB/s
    Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib==3.1.3) (1.4.0)
    Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib==3.1.3) (0.11.0)
    Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib==3.1.3) (2.8.2)
    Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib==3.1.3) (3.0.7)
    Requirement already satisfied: numpy>=1.11 in /usr/local/lib/python3.7/dist-packages (from matplotlib==3.1.3) (1.19.5)
    Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from kiwisolver>=1.0.1->matplotlib==3.1.3) (3.7.4.3)
    Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.1->matplotlib==3.1.3) (1.15.0)
    Installing collected packages: matplotlib
      Attempting uninstall: matplotlib
        Found existing installation: matplotlib 3.5.1
        Uninstalling matplotlib-3.5.1:
          Successfully uninstalled matplotlib-3.5.1
    ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    yellowbrick 1.4 requires scikit-learn>=1.0.0, but you have scikit-learn 0.22.2.post1 which is incompatible.
    machine-learning-datasets 0.1.16.4 requires alibi<0.6.0,>=0.5.5, but you have alibi 0.6.5 which is incompatible.
    machine-learning-datasets 0.1.16.4 requires matplotlib<4.0.0,>=3.2.2, but you have matplotlib 3.1.3 which is incompatible.
    albumentations 0.1.12 requires imgaug<0.2.7,>=0.2.5, but you have imgaug 0.2.9 which is incompatible.
    Successfully installed matplotlib-3.1.3

```python
ccdefault_all_df = mldatasets.load("cc-default", prepare=True)

```

    https://github.com/PacktPublishing/Interpretable-Machine-Learning-with-Python/raw/master/datasets/cc_defaults_taiwan.csv.zip downloaded to /content/data/cc_defaults_taiwan.csv.zip
    /content/data/cc_defaults_taiwan.csv.zip uncompressed to /content/data/cc_defaults_taiwan.csv
    1 dataset files found in /content/data/cc_defaults_taiwan.csv folder
    parsing /content/data/cc_defaults_taiwan.csv/cc_defaults_new_taiwan.csv

```python
ccdefault_all_df.info()

```

    <class 'pandas.core.frame.DataFrame'>
    Int64Index: 30000 entries, 1 to 30000
    Data columns (total 31 columns):
     #   Column            Non-Null Count  Dtype
    ---  ------            --------------  -----
     0   CC_LIMIT_CAT      30000 non-null  int8
     1   EDUCATION         30000 non-null  int8
     2   MARITAL_STATUS    30000 non-null  int8
     3   GENDER            30000 non-null  int8
     4   AGE_GROUP         30000 non-null  int8
     5   pay_status_1      30000 non-null  int8
     6   pay_status_2      30000 non-null  int8
     7   pay_status_3      30000 non-null  int8
     8   pay_status_4      30000 non-null  int8
     9   pay_status_5      30000 non-null  int8
     10  pay_status_6      30000 non-null  int8
     11  paid_pct_1        30000 non-null  float64
     12  paid_pct_2        30000 non-null  float64
     13  paid_pct_3        30000 non-null  float64
     14  paid_pct_4        30000 non-null  float64
     15  paid_pct_5        30000 non-null  float64
     16  paid_pct_6        30000 non-null  float64
     17  bill1_over_limit  30000 non-null  float64
     18  IS_DEFAULT        30000 non-null  int8
     19  _AGE              30000 non-null  int16
     20  _spend            30000 non-null  int32
     21  _tpm              30000 non-null  int16
     22  _ppm              30000 non-null  int16
     23  _RETAIL           30000 non-null  int8
     24  _URBAN            30000 non-null  int8
     25  _RURAL            30000 non-null  int8
     26  _PREMIUM          30000 non-null  int8
     27  _TREATMENT        30000 non-null  int8
     28  _LTV              30000 non-null  float64
     29  _CC_LIMIT         30000 non-null  int32
     30  _risk_score       30000 non-null  float64
    dtypes: float64(9), int16(3), int32(2), int8(17)
    memory usage: 3.2 MB

```python
ccdefault_all_df._TREATMENT.value_counts()

```

    -1    28904
     0      274
     1      274
     2      274
     3      274
    Name: _TREATMENT, dtype: int64

```python
ccdefault_bias_df = ccdefault_all_df[ccdefault_all_df._TREATMENT < 1]
ccdefault_causal_df = ccdefault_all_df[ccdefault_all_df._TREATMENT >= 0]
```

```python

```