365 potentially remove interactionvaluesvalues #398
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses #365 and #385 by changing
InteractionValues.values
andInteractionValues.interaction_lookup
them into properties. IntroducingInteractionValues.interactions
as the main part working with interactions.We remove
finalize_computed_interactions
and incorporate it into the__init__
ofInteractionValues
.Removal 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.