[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.
This commit is contained in:
Jiaming Yuan 2023-01-04 13:04:04 +08:00 committed by GitHub
parent 8d545ab2a2
commit 6eaddaa9c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -5,7 +5,7 @@ import xgboost as xgb
try:
import shap
except ImportError:
except Exception:
shap = None
pass