-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix deprecated use of xgboost early_stopping_rounds (#3306)
* add test clustering * run test only if xgboost is present --------- Co-authored-by: connortann <71127464+connortann@users.noreply.github.com>
- Loading branch information
1 parent
8f41a7e
commit 5121282
Showing
2 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import numpy as np | ||
import pytest | ||
|
||
from shap.utils import hclust | ||
|
||
|
||
def test_hclust_runs(): | ||
# GH 3290 | ||
pytest.importorskip('xgboost') | ||
X = np.column_stack((np.arange(1, 10), np.arange(100, 1000, step=100))) | ||
y = np.where(X[:, 0] > 5, 1, 0) | ||
|
||
clustered = hclust(X, y) | ||
# just check if clustered ran successfully | ||
assert isinstance(clustered, np.ndarray) |