parent
62ed8b5fef
commit
575fba651b
@ -1,9 +1,9 @@
|
|||||||
from sklearn.datasets import load_iris
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas
|
import pandas
|
||||||
|
from sklearn.datasets import load_iris
|
||||||
|
|
||||||
X, y = load_iris(return_X_y=True)
|
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'])
|
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'}
|
class_id_to_name = {0:'Iris-setosa', 1:'Iris-versicolor', 2:'Iris-virginica'}
|
||||||
df['class'] = np.vectorize(class_id_to_name.get)(y)
|
df['class'] = np.vectorize(class_id_to_name.get)(y)
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import pytest
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
import shap
|
import shap
|
||||||
except ImportError:
|
except Exception:
|
||||||
shap = None
|
shap = None
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user