You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am evaluating a model available via an API which takes in tabular data (numeric + categorical variables). I created a custom scikit learn model which queries api and returns results.
To explain this model, I tried to use
where pipeline.predict is the function giving out predictions, X is the inputs (with numeric + categorical variables). But this throws an error:
File "/home/venv/lib/python3.11/site-packages/shap/maskers/_tabular.py", line 157, in invariants
return np.isclose(x, self.data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/venv/lib/python3.11/site-packages/numpy/core/numeric.py", line 2348, in isclose
xfin = isfinite(x)
^^^^^^^^^^^
TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Am I doing anything wrong? How can I get shapley values for a model which takes in categorical variables as well?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am evaluating a model available via an API which takes in tabular data (numeric + categorical variables). I created a custom scikit learn model which queries api and returns results.
To explain this model, I tried to use
where
pipeline.predict
is the function giving out predictions,X
is the inputs (with numeric + categorical variables). But this throws an error:Am I doing anything wrong? How can I get shapley values for a model which takes in categorical variables as well?
Beta Was this translation helpful? Give feedback.
All reactions