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