Open jckkvs opened 5 months ago
Sorry @jckkvs this slipped through
Re (1) totally agree an exception would be better - we will make that change
Re (2) FACET relies on the shap
package for all SHAP calculations. I agree it would be great to see support for interaction values for a broader set of models - probably best to raise that to the shap
maintainers. Alternatively we may consider adding our own interaction explainer to a future version of FACET (in our own work, we find that ensemble models work great so we're fine using the TreeExplainer)
That's right, for SHAP interaction values I believe you are mostly limited to tree based models.
@mtsokol
https://github.com/BCG-X-Official/facet/issues/374 related.
Thank you. I have modified your code and considered non-linear models such as KernelRidge.
However, KernelRidge is naturally not compatible with TreeExplainerFactory, so I considered using KernelExplainerFactory or ExactExplainerFactory. However, since ExactExplainerFactory is not usable depending on the size of the dataset, I adopted KernelExplainerFactory(shap_interaction=True).
In this case, a RuntimeError occurs. RuntimeError: SHAP interaction values have not been calculated. Create an inspector with parameter 'shap_interaction=True' to enable calculations involving SHAP interaction values.
Checking your implementation, it seems that KernelExplainerFactory does not compute shap_interaction. https://github.com/BCG-X-Official/facet/blob/66bea1574e7a05e8db13cc25b5f071a260d0f66b/src/facet/explanation/_explanation.py#L377 https://github.com/BCG-X-Official/facet/blob/66bea1574e7a05e8db13cc25b5f071a260d0f66b/src/facet/inspection/_learner_inspector.py#L139
I have two questions. 1. For non-linear models, is it necessary to use ExactExplainerFactory and perform inspector.fit()? What should I do if the data size is large? 2. The specification that KernelExplainerFactory internally converts shap_interaction=True to False is confusing. Would it be better to throw an error if shap_interaction=True is specified, or change it so that the shap_interaction argument cannot be specified at all?