Skip to content
Back to skills

Explainability

ASecurity

"Configure PyTorch Geometric Explainer workflows, explanation

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
testingpythongobashnodeapi

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill explainability --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Explainability?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Explainability
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-explainability/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-explainability)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: explainability
description: "Configure PyTorch Geometric Explainer workflows, explanation
  algorithms, masks, thresholds, metrics, and explainability failure recovery."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# Explainability

Use this sub-skill when configuring `torch_geometric.explain.Explainer`, choosing algorithms such as `GNNExplainer`, generating homogeneous or heterogeneous explanations, applying mask thresholds, evaluating explanation metrics, or recovering from explainability-specific configuration failures.

Do not use this sub-skill for training a production base model from scratch, designing generic GNN architectures, building heterogeneous graph schemas, sampling at scale, or dataset construction. Route those to sibling sub-skills when present, then return here once the model exposes a stable forward signature to explain.

## Start Here

- Read `references/explainer-api.md` when choosing `Explainer`, `GNNExplainer`, `Explanation`, `HeteroExplanation`, `ModelConfig`, mask types, threshold types, or metric APIs.
- Read `references/explanation-workflows.md` when implementing node, graph, link, or heterogeneous explanation workflows and deciding how to pass `target`, `index`, `batch`, or typed dictionaries.
- Read `references/troubleshooting.md` when errors mention `model_config`, missing mask types, invalid thresholds, unavailable masks, hetero routing, repeated backward passes, or slow explainer epochs.
- Run `scripts/tiny_explainer_smoke.py --epochs 2` to verify a CPU-only synthetic `GNNExplainer` path without downloads, GPUs, credentials, or long training.

## Common Tasks

- Wrap a trained PyG model with `Explainer(model, algorithm=GNNExplainer(...), explanation_type='model', model_config=..., node_mask_type=..., edge_mask_type=...)`.
- Match `model_config` to actual model output: `mode` is `binary_classification`, `multiclass_classification`, or `regression`; `task_level` is `node`, `edge`, or `graph`; `return_type` is `raw`, `probs`, or `log_probs`.
- Use at least one mask type: `node_mask_type='attributes'`, `'common_attributes'`, or `'object'`; `edge_mask_type='object'` or `None`.
- Explain a specific node or output row with `explanation = explainer(x, edge_index, index=node_index)` and inspect `explanation.available_explanations`, `explanation.node_mask`, and `explanation.edge_mask`.
- Evaluate classification explanations with metrics such as `fidelity(explainer, explanation)` or `unfaithfulness(explainer, explanation)` after confirming the explanation has the masks those metrics need.

## Safe Validation

```bash
python scripts/tiny_explainer_smoke.py --epochs 2
python scripts/tiny_explainer_smoke.py --epochs 1 --threshold-topk 3 --node-index 2
python scripts/tiny_explainer_smoke.py --help
```

Expected output includes available explanation mask names, node/edge mask shapes, finite mask sums, model prediction for the explained node, and `tiny_explainer_smoke: ok`.

Files in this skill

  • SKILL.md2.9 KB
  • references/explainer-api.md5.5 KB
  • references/explanation-workflows.md5.9 KB
  • references/troubleshooting.md5.5 KB
  • scripts/tiny_explainer_smoke.py6.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.