20
20
21
21
def check_input_validity_for_querying_explainability_result (func : Callable ) -> Callable :
22
22
"""
23
- A decorator that validates the input parameters of a method that query the ExplainabilityResult (e.g .,
24
- get_explanation(), get_feature_values()).
23
+ A decorator that validates the input parameters of a method that queries the ExplainabilityResult (i.e .,
24
+ get_explanation(), get_feature_values(), and get_shap_explanation_object ).
25
25
"""
26
26
27
27
@wraps (func )
@@ -73,7 +73,6 @@ def __init__(
73
73
Dict [integer , Dict [str , TimeSeries ]],
74
74
Sequence [Dict [integer , Dict [str , TimeSeries ]]],
75
75
],
76
- # Original SHAP explanation object in case SHAP is used by ForecastingModelExplainer
77
76
shap_explanation_object : Optional [
78
77
Union [
79
78
Dict [integer , Dict [str , shap .Explanation ]],
@@ -131,7 +130,7 @@ def get_feature_values(
131
130
horizon
132
131
The horizon for which to return the feature values.
133
132
component
134
- The component for which to return the explanation . Does not
133
+ The component for which to return the feature values . Does not
135
134
need to be specified for univariate series.
136
135
"""
137
136
if isinstance (self .feature_values , list ):
@@ -147,14 +146,15 @@ def get_shap_explanation_object(
147
146
self , horizon : int , component : Optional [str ] = None
148
147
) -> Union [shap .Explanation , Sequence [shap .Explanation ]]:
149
148
"""
150
- Returns one or several shap.Explanations objects for a given horizon and component.
149
+ In case, SHAP is used by the :class:`ForecastingModelExplainer` to explain the forecast, this method
150
+ returns the underlying `shap.Explanations` object(s) for a given horizon and component.
151
151
152
152
Parameters
153
153
----------
154
154
horizon
155
- The horizon for which to return the feature values .
155
+ The horizon for which to return the `shap.Explanations` object(s) .
156
156
component
157
- The component for which to return the explanation . Does not
157
+ The component for which to return the `shap.Explanations` object(s) . Does not
158
158
need to be specified for univariate series.
159
159
"""
160
160
if not self .shap_explanation_object :
0 commit comments