Skip to content

Commit

Permalink
another fix for doc build due to missing docs on properties (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
imatiach-msft authored Apr 6, 2020
1 parent b5f8a40 commit 66cbfd5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions python/interpret_community/explanation/explanation.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,20 @@ def visualize(self, key=None):
@property
@abstractmethod
def selector(self):
"""Get the local or global selector.
:return: The selector as a pandas dataframe of records.
:rtype: pd.DataFrame
"""
return None

@property
def name(self):
"""Get the name of the explanation.
:return: The name of the explanation.
:rtype: str
"""
return gen_name_from_class(self)

@staticmethod
Expand Down Expand Up @@ -542,6 +552,11 @@ def data(self, key=None):

@property
def selector(self):
"""Get the local selector.
:return: The selector as a pandas dataframe of records.
:rtype: pd.DataFrame
"""
predicted = self._eval_y_predicted
dataset_shape = np.empty((self._local_importance_values.shape[-2], 1))
return gen_local_selector(dataset_shape, None, predicted.flatten())
Expand Down Expand Up @@ -766,6 +781,11 @@ def data(self, key=None):

@property
def selector(self):
"""Get the global selector if this is only a global explanation otherwise local.
:return: The selector as a pandas dataframe of records.
:rtype: pd.DataFrame
"""
if LocalExplanation._does_quack(self):
return LocalExplanation.selector.__get__(self)
nan_predicted = np.empty((1, 1))
Expand Down

0 comments on commit 66cbfd5

Please sign in to comment.