Time series

From VectorSpaceLab/AREX-Skill · View interactive version

Time series is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Use AIX360 TSICE, TSLime, and TSSaliency for local numeric explanations of univariate or multivariate time-series models, including temporal perturbations, relevant history, exogenous inputs, and integrated-gradient saliency.

How to use this skill

Skill file

Time-Series Local Explanations

Use this sub-skill for AIX360 0.3.0 local explanations over an ordered history

window. It covers:

time/feature weights.

a base signal using a model-agnostic Monte Carlo gradient.

features to changes in a multi-step forecast.

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

local-black-box.

datasets-and-metrics. For offline

explanation tests, construct an in-memory fixture instead.

counterfactual-and-certification.

Operating contract

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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

cell with increasing the selected scalar model response; it is local and

perturbation-distribution dependent, not a causal effect.

signal and approximate path integral. Magnitude is comparable across cells

only after considering feature scales and the same base/configuration.

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.

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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.