From c21c80bb9e009292e2ee20f2010cfffbe7a67a47 Mon Sep 17 00:00:00 2001 From: dsgibbons Date: Tue, 9 May 2023 07:01:30 +0930 Subject: [PATCH] fix: remove np.bool in notebooks --- .../tree_based_models/Python Version of Tree SHAP.ipynb | 4 ++-- .../tree_shap_paper/Tree SHAP in Python.ipynb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/notebooks/tabular_examples/tree_based_models/Python Version of Tree SHAP.ipynb b/notebooks/tabular_examples/tree_based_models/Python Version of Tree SHAP.ipynb index e3d8fcdb5..8e7ee2569 100644 --- a/notebooks/tabular_examples/tree_based_models/Python Version of Tree SHAP.ipynb +++ b/notebooks/tabular_examples/tree_based_models/Python Version of Tree SHAP.ipynb @@ -143,13 +143,13 @@ " # single instance\n", " if len(X.shape) == 1:\n", " phi = np.zeros(X.shape[0] + 1)\n", - " x_missing = np.zeros(X.shape[0], dtype=np.bool)\n", + " x_missing = np.zeros(X.shape[0], dtype=bool)\n", " for t in self.trees:\n", " self.tree_shap(t, X, x_missing, phi)\n", " phi /= len(self.trees)\n", " elif len(X.shape) == 2:\n", " phi = np.zeros((X.shape[0], X.shape[1] + 1))\n", - " x_missing = np.zeros(X.shape[1], dtype=np.bool)\n", + " x_missing = np.zeros(X.shape[1], dtype=bool)\n", " for i in range(X.shape[0]):\n", " for t in self.trees:\n", " self.tree_shap(t, X[i,:], x_missing, phi[i,:])\n", diff --git a/notebooks/tabular_examples/tree_based_models/tree_shap_paper/Tree SHAP in Python.ipynb b/notebooks/tabular_examples/tree_based_models/tree_shap_paper/Tree SHAP in Python.ipynb index d90ca4c7b..19f7b5cf0 100644 --- a/notebooks/tabular_examples/tree_based_models/tree_shap_paper/Tree SHAP in Python.ipynb +++ b/notebooks/tabular_examples/tree_based_models/tree_shap_paper/Tree SHAP in Python.ipynb @@ -128,13 +128,13 @@ " # single instance\n", " if len(X.shape) == 1:\n", " phi = np.zeros(X.shape[0] + 1)\n", - " x_missing = np.zeros(X.shape[0], dtype=np.bool)\n", + " x_missing = np.zeros(X.shape[0], dtype=bool)\n", " for t in self.trees:\n", " self.tree_shap(t, X, x_missing, phi)\n", " phi /= len(self.trees)\n", " elif len(X.shape) == 2:\n", " phi = np.zeros((X.shape[0], X.shape[1] + 1))\n", - " x_missing = np.zeros(X.shape[1], dtype=np.bool)\n", + " x_missing = np.zeros(X.shape[1], dtype=bool)\n", " for i in range(X.shape[0]):\n", " for t in self.trees:\n", " self.tree_shap(t, X[i,:], x_missing, phi[i,:])\n",