Skip to content

Commit

Permalink
Merge pull request #605 from guillaume-vignal/feature/fix_feature_imp…
Browse files Browse the repository at this point in the history
…otance_local

Fix for Feature Importance Local Plot Failure After Global Plot
  • Loading branch information
guillaume-vignal authored Oct 25, 2024
2 parents 1693693 + f7bfe57 commit d4f783c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions shapash/explainer/smart_explainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,17 +951,17 @@ def compute_features_import(self, force=False, local=False):
contributions=self.contributions, explain_data=self.explain_data, subset=None, norm=1
)

if self.features_groups is not None and self.features_imp_groups is None:
self.features_imp_groups = self.state.compute_features_import(self.contributions_groups, norm=1)

if local:
self.features_imp_local_lev1 = self.backend.get_global_features_importance(
contributions=self.contributions, explain_data=self.explain_data, subset=None, norm=3
)
self.features_imp_local_lev2 = self.backend.get_global_features_importance(
contributions=self.contributions, explain_data=self.explain_data, subset=None, norm=7
)

if self.features_groups is not None and self.features_imp_groups is None:
self.features_imp_groups = self.state.compute_features_import(self.contributions_groups, norm=1)
if local:
if self.features_groups is not None:
self.features_imp_groups_local_lev1 = self.state.compute_features_import(
self.contributions_groups, norm=3
)
Expand Down

0 comments on commit d4f783c

Please sign in to comment.