-
Notifications
You must be signed in to change notification settings - Fork 38
365 potentially remove interactionvaluesvalues #398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is amazing ... but we really gotta be careful integrating this haha 😂 |
We could add this logic actually also to our game class ... I don't see if there is something which speaks against this. |
f8716d1
to
7a71c49
Compare
The coda quality error seems to be originate in |
I also do not get any local pre-commit changes. I will try to print the changes in the workflow and see what happens. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hade one comment against defensive type checks. Otherwise this is good to go! 🫶🫡
This pull request addresses #365 and #385 by changing
InteractionValues.values
andInteractionValues.interaction_lookup
into properties. IntroducingInteractionValues.interactions
as the main part working with interactions.We remove
finalize_computed_interactions
and incorporate it into the__init__
ofInteractionValues
.Adding Logic into
shapiq.Game
:.coalition_values
dictionary, mapping coalitions to their game values.coalition_values
..value_storage
and.coalition_lookup
to be properties of theGame
classRemoval of
finalize_computed_interactions
:Updated all
approximate
methods in various approximator modules (owen.py
,stratified.py
,montecarlo/_base.py
,permutation/sii.py
,permutation/stii.py
,permutation/sv.py
,regression/_base.py
,sparse/_base.py
) to directly returnInteractionValues
with thetarget_index
property included. This eliminates the need for thefinalize_computed_interactions
function. [1] [2] [3] [4] [5] [6] [7] [8]Updated the
explain_function
intabular.py
andtree/explainer.py
to replace calls tofinalize_computed_interactions
with direct instantiation ofInteractionValues
. [1] [2]Simplification of imports:
finalize_computed_interactions
from imports in all affected files, as it is no longer used. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]These changes improve the maintainability of the code by reducing complexity and removing unnecessary dependencies.