Skip to content

Update explainer_base.py #424

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions dice_ml/data_interfaces/private_data_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,7 @@ def get_features_range(self, permitted_range_input=None, features_dict=None):

ranges = {}
# Getting default ranges based on the dataset
for feature in features_dict:
if type(features_dict[feature][0]) is int: # continuous feature
ranges[feature] = features_dict[feature]
else:
ranges[feature] = features_dict[feature]
ranges[feature] = features_dict[feature]
feature_ranges_orig = ranges.copy()
# Overwriting the ranges for a feature if input provided
if permitted_range_input is not None:
Expand Down
7 changes: 1 addition & 6 deletions dice_ml/explainer_interfaces/explainer_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,7 @@ def setup(self, features_to_vary, permitted_range, query_instance, feature_weigh
if features_to_vary == 'all':
features_to_vary = self.data_interface.feature_names

if permitted_range is None: # use the precomputed default
self.feature_range = self.data_interface.permitted_range
feature_ranges_orig = self.feature_range
else: # compute the new ranges based on user input
self.feature_range, feature_ranges_orig = self.data_interface.get_features_range(permitted_range)

self.feature_range, feature_ranges_orig = self.data_interface.get_features_range(permitted_range)
self.check_query_instance_validity(features_to_vary, permitted_range, query_instance, feature_ranges_orig)

return features_to_vary
Expand Down