Open Shuva105 opened 4 days ago
Hi, Shuva105 thank you for your interest in TreeSHAP-IQ. To do so, you need to pass your model first to the correct converter and pass the retrieved TreeModel object to the TreeSHAP-IQ algorithm.
Having said that, this repository is not necessarily fit for conducting experiments outside the scope of the original research paper. This is why we launched the shapiq
project with a follow-up paper here. shapiq
is a software package that brings together a bunch of Shapley value and Shapley interaction algorithms including TreeSHAP-IQ in its TreeExplainer
explainer class. If you are interested in TreeSHAP-IQ you should definitely check out the implementation there. If you encounter problems with this project, please don't hesitate to open an issue there! :)
I am trying to use TreeShapIQ with an XGBoost model, but I keep encountering a ValueError indicating that the tree model must be either a dictionary or a TreeModel object. Despite passing both a booster object and transformed JSON-like structures, the error persists.
I attempted to pass the booster directly to TreeShapIQ as shown in the code below:
However, this results in the ValueError mentioned above.
I also tried dumping the booster into JSON format, transforming it to the expected dictionary structure, and passing that to TreeShapIQ, but it didn’t resolve the issue either.
I tried converting this structure into a format that TreeShapIQ might accept (by adding children_left and children_right keys), but this did not fix the issue.
What exact structure does the TreeShapIQ class expect as input? Should the XGBoost booster object work directly, or do I need to transform it into a specific format before passing it? If transformations are necessary, could you provide guidance or examples of the correct format? Any help or advice would be greatly appreciated!