From 6eaddaa9c3cdcf4b97debb4a64020eedc159fae7 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Wed, 4 Jan 2023 13:04:04 +0800 Subject: [PATCH] [CI] Fix CI with updated dependencies. (#8631) * [CI] Fix CI with updated dependencies. - Fix jvm package get iris. * Skip SHAP test for now. * Revert "Skip SHAP test for now." This reverts commit 9aa28b4d8aee53fa95d92d2a879c6783ff4b2faa. * Catch all exceptions. --- jvm-packages/xgboost4j-tester/get_iris.py | 4 ++-- tests/python/test_with_shap.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jvm-packages/xgboost4j-tester/get_iris.py b/jvm-packages/xgboost4j-tester/get_iris.py index f234bb95e..728c149b0 100644 --- a/jvm-packages/xgboost4j-tester/get_iris.py +++ b/jvm-packages/xgboost4j-tester/get_iris.py @@ -1,9 +1,9 @@ -from sklearn.datasets import load_iris import numpy as np import pandas +from sklearn.datasets import load_iris X, y = load_iris(return_X_y=True) -y = y.astype(np.int) +y = y.astype(np.int32) df = pandas.DataFrame(data=X, columns=['sepal length', 'sepal width', 'petal length', 'petal width']) class_id_to_name = {0:'Iris-setosa', 1:'Iris-versicolor', 2:'Iris-virginica'} df['class'] = np.vectorize(class_id_to_name.get)(y) diff --git a/tests/python/test_with_shap.py b/tests/python/test_with_shap.py index 3103e1b7e..4a38193c1 100644 --- a/tests/python/test_with_shap.py +++ b/tests/python/test_with_shap.py @@ -5,7 +5,7 @@ import xgboost as xgb try: import shap -except ImportError: +except Exception: shap = None pass