Counterfactual and certification
Use this route when the request is about a contrastive explanation, a
pertinent positive or negative, actionable recourse, a robustness/trust-region
certificate, or an alternative matching under transport/order constraints.
The route covers AIX360 0.3.0 APIs; it does not promise that every optional
backend can be installed in the current environment.
Route by goal
- CEM / CEM-MAF: image or array contrastive explanations. A pertinent
positive (PP) retains the minimum sufficient content for the original class;
a pertinent negative (PN) is added content whose presence changes the class.
Use the API and legacy-backend caveats in api-reference.md.
- Ecertify: certify a scalar quality/fidelity callable in a neighborhood of
one instance. This is black-box, query-budgeted, and probabilistic/empirical;
it is not an exhaustive proof over arbitrary data domains.
- GLANCE: generate local counterfactuals or global subgroup actions for a
binary tabular model. Make favorable class
1, numeric/categorical columns,
immutable features, and the cost definition explicit before fitting.
- OTMatching: produce alternative transport plans and salient changed
positions while preserving row/column marginals within the configured error
tolerance. The matching and costs must already be prepared by the caller.
Do not route here
Required inputs
Before invoking an algorithm, record:
- The input representation and shape, target/favorable class, and the model
prediction interface.
- Which features or pixels may change, hard lower/upper bounds, and whether
categorical changes, monotonic directions, or immutable columns must be
enforced outside the algorithm.
- The expected output: counterfactual array, action table, certificate width,
or list of matching alternatives; also record the acceptance test.
- Optional-dependency and network policy. Never start a model, image, GAN,
embedding, or dataset download as an implicit side effect.
Safe decision flow
- Validate shapes, dtypes, finite values, class semantics, and constraints
with a tiny local fixture. For GLANCE, apply candidate actions and re-run
the model; for matching, check non-negativity and marginal sums.
- Prefer the CPU-oriented GLANCE action/cost primitives, a small synthetic
Ecertify quality function, or a tiny transport plan for verification.
- Treat contrastive image execution as optional until the TensorFlow 1.x and
Keras stack, model assets, and input preprocessing have been independently
confirmed. Do not substitute a modern TensorFlow result for that historical
path.
- Treat a returned candidate as a proposal: re-predict it, check bounds and
actionability, and report fewer-than-requested or no-solution outcomes.
- Summarize approximation, random seeds, query budgets, dependency failures,
and unverified paths with the result.
Output and handoff
Return the requested artifact together with the input shape, target/favorable
class, constraint policy, model-output adapter, dependency status, and a
post-call validation result. Distinguish a valid candidate from a failed or
empty search. For a certificate, include width, strategy, query budget, and
confidence interpretation; for GLANCE, include effectiveness and cost
semantics; for matching, include marginal residuals and salient positions.
See api-reference.md for signatures and output
contracts, workflows.md for no-network recipes, and
troubleshooting.md for recovery boundaries.
1---2name: counterfactual-and-certification3description: "Use AIX360 for contrastive CEM/CEM-MAF explanations, black-box4 certification, GLANCE recourse, and order-constrained optimal-transport5 matching."6disable-model-invocation: true7metadata:8 source: https://skillmd.com/skills/vectorspacelab/counterfactual-and-certification9 disco-role: operating10license: Apache 2.011---1213# Counterfactual and certification1415Use this route when the request is about a contrastive explanation, a16pertinent positive or negative, actionable recourse, a robustness/trust-region17certificate, or an alternative matching under transport/order constraints.18The route covers AIX360 0.3.0 APIs; it does not promise that every optional19backend can be installed in the current environment.2021## Route by goal2223- **CEM / CEM-MAF**: image or array contrastive explanations. A pertinent24 positive (PP) retains the minimum sufficient content for the original class;25 a pertinent negative (PN) is added content whose presence changes the class.26 Use the API and legacy-backend caveats in [api-reference.md](references/api-reference.md).27- **Ecertify**: certify a scalar quality/fidelity callable in a neighborhood of28 one instance. This is black-box, query-budgeted, and probabilistic/empirical;29 it is not an exhaustive proof over arbitrary data domains.30- **GLANCE**: generate local counterfactuals or global subgroup actions for a31 binary tabular model. Make favorable class `1`, numeric/categorical columns,32 immutable features, and the cost definition explicit before fitting.33- **OTMatching**: produce alternative transport plans and salient changed34 positions while preserving row/column marginals within the configured error35 tolerance. The matching and costs must already be prepared by the caller.3637## Do not route here3839- LIME, SHAP, GroupedCE, or nearest-neighbor contrastive explanations go to40 [../local-black-box/SKILL.md](../local-black-box/SKILL.md).41- Rules, prototypes, IMD, or TED go to42 [../interpretable-models/SKILL.md](../interpretable-models/SKILL.md).43- Time-series explanations go to44 [../time-series/SKILL.md](../time-series/SKILL.md).45- Dataset-loader ownership and download lifecycle go to46 [../datasets-and-metrics/SKILL.md](../datasets-and-metrics/SKILL.md).4748## Required inputs4950Before invoking an algorithm, record:51521. The input representation and shape, target/favorable class, and the model53 prediction interface.542. Which features or pixels may change, hard lower/upper bounds, and whether55 categorical changes, monotonic directions, or immutable columns must be56 enforced outside the algorithm.573. The expected output: counterfactual array, action table, certificate width,58 or list of matching alternatives; also record the acceptance test.594. Optional-dependency and network policy. Never start a model, image, GAN,60 embedding, or dataset download as an implicit side effect.6162## Safe decision flow63641. Validate shapes, dtypes, finite values, class semantics, and constraints65 with a tiny local fixture. For GLANCE, apply candidate actions and re-run66 the model; for matching, check non-negativity and marginal sums.672. Prefer the CPU-oriented GLANCE action/cost primitives, a small synthetic68 Ecertify quality function, or a tiny transport plan for verification.693. Treat contrastive image execution as optional until the TensorFlow 1.x and70 Keras stack, model assets, and input preprocessing have been independently71 confirmed. Do not substitute a modern TensorFlow result for that historical72 path.734. Treat a returned candidate as a proposal: re-predict it, check bounds and74 actionability, and report fewer-than-requested or no-solution outcomes.755. Summarize approximation, random seeds, query budgets, dependency failures,76 and unverified paths with the result.7778## Output and handoff7980Return the requested artifact together with the input shape, target/favorable81class, constraint policy, model-output adapter, dependency status, and a82post-call validation result. Distinguish a valid candidate from a failed or83empty search. For a certificate, include width, strategy, query budget, and84confidence interpretation; for GLANCE, include effectiveness and cost85semantics; for matching, include marginal residuals and salient positions.8687See [api-reference.md](references/api-reference.md) for signatures and output88contracts, [workflows.md](references/workflows.md) for no-network recipes, and89[troubleshooting.md](references/troubleshooting.md) for recovery boundaries.