Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
When i am using RandomForestRegressor or XGBoost, there is no problem like this. Since i am using Relevance Vector Regression i got this error.
from sklearn_rvm import EMRVR
model_rvr=EMRVR(kernel="linear").fit(X, y)
explainer = shap.Explainer(model_rvr)
Exception: The passed model is not callable and cannot be analyzed
directly with the given masker! Model: None
Also same problem as Exception: The passed model is not callable and cannot be analyzed directly with the given masker
For Relevance Vector Regression => https://sklearn-rvm.readthedocs.io/en/latest/index.html
Any idea ?
–
I have had the same issue with a different model. The solution that worked for me was to use KernelExplainer instead of explainer. Additionally you need to use the model.predict function instead of just the model.
So your code should be:
from sklearn_rvm import EMRVR
model_rvr=EMRVR(kernel="linear").fit(X, y)
explainer = shap.KernelExplainer(model_rvr.predict, X)
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.