Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support categorical splits in in TreeExplainer #4473

Merged
merged 44 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9eb9e99
Break up path processing logic in TreeSHAP explainer
hcho3 Dec 4, 2021
e715724
Fix style
hcho3 Dec 4, 2021
94db1a1
Support cuML RF classifier in TreeExplainer
hcho3 Dec 10, 2021
386b36b
Merge remote-tracking branch 'origin/branch-22.02' into classifier_su…
hcho3 Dec 14, 2021
3cde92a
Fix style
hcho3 Dec 14, 2021
7b66105
Remove print()
hcho3 Dec 14, 2021
87ebc93
Test multiple input types in test_cuml_rf_classifier
hcho3 Dec 14, 2021
21a2bb9
Test scikit-learn RF regressors and classifiers
hcho3 Dec 14, 2021
ade0448
Make scikit-learn optional
hcho3 Dec 14, 2021
e3667c4
Fix style
hcho3 Dec 14, 2021
87458a6
Consolidate path extraction logic
hcho3 Dec 17, 2021
d0dcefd
Use shap.explainers.Tree
hcho3 Dec 17, 2021
729e98d
Fix style
hcho3 Dec 18, 2021
80e45a5
Use weighted sample count in sklearn models
hcho3 Dec 20, 2021
69d6461
Add missing skipif mark
hcho3 Dec 20, 2021
cc54ae1
Extract traverse_towards_leaf_node()
hcho3 Dec 22, 2021
4da8485
Eliminate the use of reference parameter
hcho3 Dec 22, 2021
b37d638
Fix style
hcho3 Dec 22, 2021
8092a1d
Fix style
hcho3 Jan 4, 2022
5fbc641
Update copyright years
hcho3 Jan 4, 2022
743e2eb
Merge remote-tracking branch 'origin/branch-22.02' into classifier_su…
hcho3 Jan 13, 2022
d2da04e
Relax test tolerance
hcho3 Jan 13, 2022
8fc907f
Temporarily use Treelite 2.2.0 for testing
hcho3 Jan 13, 2022
f15c7a5
Temporarily use Treelite 2.2.0 for testing
hcho3 Jan 14, 2022
589d18a
Fix copyright years
hcho3 Jan 14, 2022
372b7b9
Use gpuci_conda_retry to remove metapackages
hcho3 Jan 14, 2022
651a9ae
Merge remote-tracking branch 'origin/branch-22.02' into classifier_su…
hcho3 Jan 15, 2022
0a4cc3e
Use Treelite 2.2.1
hcho3 Jan 15, 2022
9045c5f
Implement Span and BitField
hcho3 Jan 19, 2022
9528e88
Make the tree walk logic generic
hcho3 Jan 19, 2022
c1061ad
First working prototype
hcho3 Jan 19, 2022
b7c2e11
Add more XGBoost tests
hcho3 Jan 19, 2022
46f2cf8
Update copyright year
hcho3 Jan 19, 2022
22caa8c
Add support for LightGBM
hcho3 Jan 19, 2022
fd23c6f
Fix style
hcho3 Jan 19, 2022
5dd56c8
Merge remote-tracking branch 'origin/branch-22.02' into classifier_su…
hcho3 Jan 25, 2022
cdb46d3
Remove temporary install step in build.sh
hcho3 Jan 25, 2022
c5b230c
Merge branch 'classifier_support' into categorical_support
hcho3 Jan 25, 2022
e234545
Respond to reviewer's comment
hcho3 Jan 26, 2022
6341641
Make shap optional in tests
hcho3 Jan 26, 2022
9f6f0c9
Add coverage for missing values
hcho3 Jan 26, 2022
f87e180
Merge remote-tracking branch 'upstream/branch-22.02' into categorical…
hcho3 Jan 26, 2022
48a6a83
Fix typo in comment
hcho3 Jan 26, 2022
f97106a
Fix style
hcho3 Jan 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ gpuci_mamba_retry install -c conda-forge -c rapidsai -c rapidsai-nightly -c nvid
"rapids-doc-env=${MINOR_VERSION}.*" \
"shap>=0.37,<=0.39"

gpuci_conda_retry remove -c conda-forge -c rapidsai -c rapidsai-nightly -c nvidia \
hcho3 marked this conversation as resolved.
Show resolved Hide resolved
--force rapids-build-env rapids-notebook-env
gpuci_mamba_retry install -c conda-forge -c rapidsai -c rapidsai-nightly -c nvidia \
treelite=2.2.1

# https://docs.rapids.ai/maintainers/depmgmt/
# gpuci_mamba_retry remove --force rapids-build-env rapids-notebook-env
# gpuci_mamba_retry install -y "your-pkg=1.0.0"
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/cuml/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ requirements:
- setuptools
- cython>=0.29,<0.30
- cmake>=3.20.1
- treelite=2.1.0
- treelite=2.2.1
- cudf {{ minor_version }}
- libcuml={{ version }}
- libcumlprims {{ minor_version }}
Expand All @@ -44,7 +44,7 @@ requirements:
- libcuml={{ version }}
- libcumlprims {{ minor_version }}
- cupy>=7.8.0,<11.0.0a0
- treelite=2.1.0
- treelite=2.2.1
- nccl>=2.9.9
- ucx-py {{ ucx_py_version }}
- ucx-proc=*=gpu
Expand Down
6 changes: 3 additions & 3 deletions conda/recipes/libcuml/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2021, NVIDIA CORPORATION.
# Copyright (c) 2018-2022, NVIDIA CORPORATION.

# Usage:
# conda build . -c conda-forge -c nvidia -c rapidsai -c pytorch
Expand Down Expand Up @@ -43,7 +43,7 @@ requirements:
- ucx-proc=*=gpu
- libcumlprims {{ minor_version }}
- lapack
- treelite=2.1.0
- treelite=2.2.1
- faiss-proc=*=cuda
- gtest=1.10.0
- gmock
Expand All @@ -55,7 +55,7 @@ requirements:
- ucx-py {{ ucx_py_version }}
- ucx-proc=*=gpu
- {{ pin_compatible('cudatoolkit', max_pin='x', min_pin='x') }}
- treelite=2.1.0
- treelite=2.2.1
- faiss-proc=*=cuda
- libfaiss 1.7.0 *_cuda
- libcusolver>=11.2.1
Expand Down
6 changes: 3 additions & 3 deletions cpp/cmake/thirdparty/get_treelite.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -54,5 +54,5 @@ function(find_and_configure_treelite)

endfunction()

find_and_configure_treelite(VERSION 2.1.0
PINNED_TAG e5248931c62e3807248e0b150e27b2530a510634)
find_and_configure_treelite(VERSION 2.2.1
PINNED_TAG 1f9c5054ad7433fa88623fccf0ae46a6ba6a27c6)
4 changes: 2 additions & 2 deletions cpp/include/cuml/explainer/tree_shap.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, NVIDIA CORPORATION.
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,7 +34,7 @@ class TreePathInfo {
};

std::unique_ptr<TreePathInfo> extract_path_info(ModelHandle model);
void gpu_treeshap(const TreePathInfo* path_info,
void gpu_treeshap(TreePathInfo* path_info,
hcho3 marked this conversation as resolved.
Show resolved Hide resolved
const float* data,
std::size_t n_rows,
std::size_t n_cols,
Expand Down
Loading