Skip to content

Commit

Permalink
fix: remove np.bool in notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
dsgibbons committed May 8, 2023
1 parent bbcdb0a commit c21c80b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c21c80b

Please sign in to comment.