Time-Series Local Explanations
Use this sub-skill for AIX360 0.3.0 local explanations over an ordered history
window. It covers:
- TSLime: perturb the history, fit a local linear surrogate, and return
time/feature weights.
- TSSaliency: estimate temporal and variate contributions along a path from
a base signal using a model-agnostic Monte Carlo gradient.
- TSICE: perturb a selected time window and relate derived time-series
features to changes in a multi-step forecast.
tsFrame, to_np_array, model wrappers, perturbation engines, and numeric
interpretation. Plotting is optional and is not part of the explanation
contract.
Route here when
Choose this skill when the request mentions TSICE, TSLime, TSSaliency, temporal
saliency, integrated gradients, relevant history, perturbation windows,
exogenous time-series variables, or time-series attribution. Read the
API reference,
data-format contract, and the relevant section of
workflows before running an explainer.
Route elsewhere
Operating contract
- Normalize first. Represent a window as a pandas
DataFrame with one row
per time step, one numeric column per variate, and a DatetimeIndex (a
tsFrame). A NumPy input must be two-dimensional (time, features) before
conversion. Preserve column order and use the same order for
feature_names and model reshaping.
- Fix the axes. Record
input_length=T, feature count F, and, for TSICE,
forecast_lookahead=H, n_variables=F_out, and the exogenous count. TSLime
accepts at least T rows and uses the last T; TSSaliency requires exactly
T; TSICE accepts at least T and uses the last T.
- Adapt the callable. Prefer a callable that handles batch arrays and
returns one numeric target per sample. TSLime and TSSaliency are single-
output explainers; aggregate a multi-output model before calling them.
TSICE instead expects each call to return
(H, n_variables) (or a length-H
vector for one output). See data formats.
- Select perturbations deliberately. Start with one small
block-bootstrap engine. Add frequency, moving-average, shift, or impute
engines only when their data assumptions fit the domain. Set a seed and use
a small perturbation count for a smoke test; perturbation count multiplies
model calls.
- Run numeric explanation before plotting. Inspect keys and shapes, compare
the instance and base predictions, and check that weights/saliency are
aligned to the intended window. A plot is a presentation layer, not a
verification gate. Plotting failures must not invalidate numeric output.
- Keep experiments offline by default. Do not invoke
SunspotDataset,
FordDataset, or ClimateDataset merely to demonstrate the explainers:
their constructors can download data. Use a deterministic tiny NumPy fixture
and a local callable; see workflows.
Choose the explainer
| Need |
Use |
Main numeric result |
| Local sensitivity over recent time/feature cells |
TSLimeExplainer |
history_weights with shape (relevant_history, F) |
| Temporal/variate attribution relative to a base signal |
TSSaliencyExplainer |
saliency with shape (T, F) |
| Forecast response to structured changes in a time window |
TSICEExplainer |
perturbation responses, feature statistics, and forecast deltas |
For exact constructors, return shapes, perturbation configuration, and wrapper
behavior, use api-reference.md. For failures,
use troubleshooting.md rather than silently
reshaping an input or output.
Interpretation guardrails
- A positive TSLime weight means the local surrogate associates increasing that
cell with increasing the selected scalar model response; it is local and
perturbation-distribution dependent, not a causal effect.
- A positive TSSaliency value is a positive contribution under the chosen base
signal and approximate path integral. Magnitude is comparable across cells
only after considering feature scales and the same base/configuration.
- TSICE
signed_impact is the average forecast change for one perturbation and
total_impact is a non-negative average RMS change. The output is a sampled
response cloud indexed by derived statistics, not a guaranteed per-feature
coefficient.
- For multi-step or multi-variable forecasts, always state whether a summary
averages horizons/variables. A scalar summary can hide cancellation.
Do not use these explainers as certification, recourse, or counterfactual
proof. Do not claim that a heatmap is an attribution result unless its numeric
source and axes have been checked.
1---2name: time-series3description: "Use AIX360 TSICE, TSLime, and TSSaliency for local numeric4 explanations of univariate or multivariate time-series models, including5 temporal perturbations, relevant history, exogenous inputs, and6 integrated-gradient saliency."7disable-model-invocation: true8metadata:9 source: https://skillmd.com/skills/vectorspacelab/time-series10 disco-role: operating11license: Apache 2.012---1314# Time-Series Local Explanations1516Use this sub-skill for AIX360 0.3.0 local explanations over an ordered history17window. It covers:1819- **TSLime**: perturb the history, fit a local linear surrogate, and return20 time/feature weights.21- **TSSaliency**: estimate temporal and variate contributions along a path from22 a base signal using a model-agnostic Monte Carlo gradient.23- **TSICE**: perturb a selected time window and relate derived time-series24 features to changes in a multi-step forecast.25- `tsFrame`, `to_np_array`, model wrappers, perturbation engines, and numeric26 interpretation. Plotting is optional and is not part of the explanation27 contract.2829## Route here when3031Choose this skill when the request mentions TSICE, TSLime, TSSaliency, temporal32saliency, integrated gradients, relevant history, perturbation windows,33exogenous time-series variables, or time-series attribution. Read the34[API reference](references/api-reference.md),35[data-format contract](references/data-formats.md), and the relevant section of36[workflows](references/workflows.md) before running an explainer.3738## Route elsewhere3940- Generic tabular, text, or image LIME/SHAP: use41 [local-black-box](../local-black-box/SKILL.md).42- Dataset download or packaging: use43 [datasets-and-metrics](../datasets-and-metrics/SKILL.md). For offline44 explanation tests, construct an in-memory fixture instead.45- CEM, certification, or recourse: use46 [counterfactual-and-certification](../counterfactual-and-certification/SKILL.md).4748## Operating contract49501. **Normalize first.** Represent a window as a pandas `DataFrame` with one row51 per time step, one numeric column per variate, and a `DatetimeIndex` (a52 `tsFrame`). A NumPy input must be two-dimensional `(time, features)` before53 conversion. Preserve column order and use the same order for54 `feature_names` and model reshaping.552. **Fix the axes.** Record `input_length=T`, feature count `F`, and, for TSICE,56 `forecast_lookahead=H`, `n_variables=F_out`, and the exogenous count. TSLime57 accepts at least `T` rows and uses the last `T`; TSSaliency requires exactly58 `T`; TSICE accepts at least `T` and uses the last `T`.593. **Adapt the callable.** Prefer a callable that handles batch arrays and60 returns one numeric target per sample. TSLime and TSSaliency are single-61 output explainers; aggregate a multi-output model before calling them.62 TSICE instead expects each call to return `(H, n_variables)` (or a length-H63 vector for one output). See [data formats](references/data-formats.md).644. **Select perturbations deliberately.** Start with one small65 `block-bootstrap` engine. Add frequency, moving-average, shift, or impute66 engines only when their data assumptions fit the domain. Set a seed and use67 a small perturbation count for a smoke test; perturbation count multiplies68 model calls.695. **Run numeric explanation before plotting.** Inspect keys and shapes, compare70 the instance and base predictions, and check that weights/saliency are71 aligned to the intended window. A plot is a presentation layer, not a72 verification gate. Plotting failures must not invalidate numeric output.736. **Keep experiments offline by default.** Do not invoke `SunspotDataset`,74 `FordDataset`, or `ClimateDataset` merely to demonstrate the explainers:75 their constructors can download data. Use a deterministic tiny NumPy fixture76 and a local callable; see [workflows](references/workflows.md).7778## Choose the explainer7980| Need | Use | Main numeric result |81|---|---|---|82| Local sensitivity over recent time/feature cells | `TSLimeExplainer` | `history_weights` with shape `(relevant_history, F)` |83| Temporal/variate attribution relative to a base signal | `TSSaliencyExplainer` | `saliency` with shape `(T, F)` |84| Forecast response to structured changes in a time window | `TSICEExplainer` | perturbation responses, feature statistics, and forecast deltas |8586For exact constructors, return shapes, perturbation configuration, and wrapper87behavior, use [api-reference.md](references/api-reference.md). For failures,88use [troubleshooting.md](references/troubleshooting.md) rather than silently89reshaping an input or output.9091## Interpretation guardrails9293- A positive TSLime weight means the local surrogate associates increasing that94 cell with increasing the selected scalar model response; it is local and95 perturbation-distribution dependent, not a causal effect.96- A positive TSSaliency value is a positive contribution under the chosen base97 signal and approximate path integral. Magnitude is comparable across cells98 only after considering feature scales and the same base/configuration.99- TSICE `signed_impact` is the average forecast change for one perturbation and100 `total_impact` is a non-negative average RMS change. The output is a sampled101 response cloud indexed by derived statistics, not a guaranteed per-feature102 coefficient.103- For multi-step or multi-variable forecasts, always state whether a summary104 averages horizons/variables. A scalar summary can hide cancellation.105106Do not use these explainers as certification, recourse, or counterfactual107proof. Do not claim that a heatmap is an attribution result unless its numeric108source and axes have been checked.