Skip to content

Commit

Permalink
docstring fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Giridhar Ganapavarapu <[email protected]>
  • Loading branch information
gganapavarapu committed Jun 26, 2023
1 parent 0a241bb commit 9eb132a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
6 changes: 5 additions & 1 deletion aix360/algorithms/gce/gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ def explain_instance(
instance (Union[pd.DataFrame, np.ndarray]): input instance to be explained.
Returns:
explanation (Union[List[Dict], Dict]): Dictionary
dict: explanation object
Dictionary with feature_name, feature_value, ice_value, current_value
for ICE explanation. Dictionary with gce_values, x_grid, y_pred,
current_values for GCE explanation.
"""

np.random.seed(self.random_seed)
Expand Down
4 changes: 2 additions & 2 deletions aix360/algorithms/nncontrastive/nncontrastive.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ def explain_instance(self, x, **kwargs):
x (Union[pd.DataFrame, np.ndarray]): input instance to be explained.
Additional Parameters:
neighbors (int): Overrides neighbors parameter provided in the init method
of NearestNeighborContrastiveExplainer.
neighbors (int): Number of neighbors
Overrides neighbors parameter provided in the initializer.
"""
if not self.is_fitted:
Expand Down
6 changes: 3 additions & 3 deletions aix360/algorithms/tsice/tsice.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ def explain_instance(
explain_params: Arbitrary explainer parameters.
Returns:
explanation (Union[List[Dict], Dict]): dictionary with data_x, feature_names,
feature_values, signed_impact, total_impact, current_forecast, current_feature_values,
perturbations and forecasts_on_perturbations.
Dict: explanation object
Dictionary with data_x, feature_names, feature_values, signed_impact, total_impact,
current_forecast, current_feature_values, perturbations and forecasts_on_perturbations.
"""

Expand Down
7 changes: 4 additions & 3 deletions aix360/algorithms/tslime/tslime.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,17 @@ def explain_instance(self, ts: tsFrame, **explain_params):
"""Explain the prediction made by the time series model at a certain point in time
(**local explanation**).
Args
Args:
ts (tsFrame): Input time series signal in ``tsFrame`` format. This can
be generated using :py:mod:`aix360.algorithms.tsframe.tsFrame`.
A ``tsFrame`` is a pandas ``DataFrame`` indexed by ``Timestamp`` objects
(that is ``DatetimeIndex``). Each column corresponds to an input feature.
explain_params: Arbitrary explainer parameters.
Returns:
explanation (Union[List[Dict], Dict]): Dictionary with keys: input_data, history_weights,
model_prediction, surrogate_prediction, x_perturbations, y_perturbations.
Dict: explanation object
Dictionary with keys: input_data, history_weights, model_prediction,
surrogate_prediction, x_perturbations, y_perturbations.
"""
return super(TSLimeExplainer, self).explain_instance(
ts=ts, ts_related=None, **explain_params
Expand Down
7 changes: 4 additions & 3 deletions aix360/algorithms/tssaliency/tssaliency.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,17 @@ def explain_instance(self, ts: tsFrame, **explain_params):
"""Explain the prediction made by the time series model at a certain point in time
(**local explanation**).
Args
Args:
ts (tsFrame): Input time series signal in ``tsFrame`` format. This can
be generated using :py:mod:`aix360.algorithms.tsframe.tsFrame`.
A ``tsFrame`` is a pandas ``DataFrame`` indexed by ``Timestamp`` objects
(that is ``DatetimeIndex``). Each column corresponds to an input feature.
explain_params: Arbitrary explainer parameters.
Returns:
explanation (Union[List[Dict], Dict]): Dictionary with keys: input_data, saliency,
feature_names, timestamps, base_value, instance_prediction, base_value_prediction.
Dict: explanation object
Dictionary with input_data, saliency, feature_names, timestamps, base_value,
instance_prediction, base_value_prediction.
"""
return super(TSSaliencyExplainer, self).explain_instance(
ts=ts, ts_related=None, **explain_params
Expand Down

0 comments on commit 9eb132a

Please sign in to comment.