Skip to content

Commit 9eb132a

Browse files
committed
docstring fixes
Signed-off-by: Giridhar Ganapavarapu <[email protected]>
1 parent 0a241bb commit 9eb132a

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

aix360/algorithms/gce/gce.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,11 @@ def explain_instance(
219219
instance (Union[pd.DataFrame, np.ndarray]): input instance to be explained.
220220
221221
Returns:
222-
explanation (Union[List[Dict], Dict]): Dictionary
222+
dict: explanation object
223+
Dictionary with feature_name, feature_value, ice_value, current_value
224+
for ICE explanation. Dictionary with gce_values, x_grid, y_pred,
225+
current_values for GCE explanation.
226+
223227
"""
224228

225229
np.random.seed(self.random_seed)

aix360/algorithms/nncontrastive/nncontrastive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ def explain_instance(self, x, **kwargs):
369369
x (Union[pd.DataFrame, np.ndarray]): input instance to be explained.
370370
371371
Additional Parameters:
372-
neighbors (int): Overrides neighbors parameter provided in the init method
373-
of NearestNeighborContrastiveExplainer.
372+
neighbors (int): Number of neighbors
373+
Overrides neighbors parameter provided in the initializer.
374374
375375
"""
376376
if not self.is_fitted:

aix360/algorithms/tsice/tsice.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@ def explain_instance(
309309
explain_params: Arbitrary explainer parameters.
310310
311311
Returns:
312-
explanation (Union[List[Dict], Dict]): dictionary with data_x, feature_names,
313-
feature_values, signed_impact, total_impact, current_forecast, current_feature_values,
314-
perturbations and forecasts_on_perturbations.
312+
Dict: explanation object
313+
Dictionary with data_x, feature_names, feature_values, signed_impact, total_impact,
314+
current_forecast, current_feature_values, perturbations and forecasts_on_perturbations.
315315
316316
"""
317317

aix360/algorithms/tslime/tslime.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,17 @@ def explain_instance(self, ts: tsFrame, **explain_params):
145145
"""Explain the prediction made by the time series model at a certain point in time
146146
(**local explanation**).
147147
148-
Args
148+
Args:
149149
ts (tsFrame): Input time series signal in ``tsFrame`` format. This can
150150
be generated using :py:mod:`aix360.algorithms.tsframe.tsFrame`.
151151
A ``tsFrame`` is a pandas ``DataFrame`` indexed by ``Timestamp`` objects
152152
(that is ``DatetimeIndex``). Each column corresponds to an input feature.
153153
explain_params: Arbitrary explainer parameters.
154154
155155
Returns:
156-
explanation (Union[List[Dict], Dict]): Dictionary with keys: input_data, history_weights,
157-
model_prediction, surrogate_prediction, x_perturbations, y_perturbations.
156+
Dict: explanation object
157+
Dictionary with keys: input_data, history_weights, model_prediction,
158+
surrogate_prediction, x_perturbations, y_perturbations.
158159
"""
159160
return super(TSLimeExplainer, self).explain_instance(
160161
ts=ts, ts_related=None, **explain_params

aix360/algorithms/tssaliency/tssaliency.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,17 @@ def explain_instance(self, ts: tsFrame, **explain_params):
9898
"""Explain the prediction made by the time series model at a certain point in time
9999
(**local explanation**).
100100
101-
Args
101+
Args:
102102
ts (tsFrame): Input time series signal in ``tsFrame`` format. This can
103103
be generated using :py:mod:`aix360.algorithms.tsframe.tsFrame`.
104104
A ``tsFrame`` is a pandas ``DataFrame`` indexed by ``Timestamp`` objects
105105
(that is ``DatetimeIndex``). Each column corresponds to an input feature.
106106
explain_params: Arbitrary explainer parameters.
107107
108108
Returns:
109-
explanation (Union[List[Dict], Dict]): Dictionary with keys: input_data, saliency,
110-
feature_names, timestamps, base_value, instance_prediction, base_value_prediction.
109+
Dict: explanation object
110+
Dictionary with input_data, saliency, feature_names, timestamps, base_value,
111+
instance_prediction, base_value_prediction.
111112
"""
112113
return super(TSSaliencyExplainer, self).explain_instance(
113114
ts=ts, ts_related=None, **explain_params

0 commit comments

Comments
 (0)