AIX360 datasets and metrics
Use this route when the task involves an AIX360 dataset, a local data directory,
preprocessing, faithfulness, monotonicity, or explanation-quality checks. It
covers data contracts and evaluation inputs; route model fitting, explainer
construction, and explanation generation to the algorithm-owning sub-skill.
Do not treat the dataset classes as download managers in an offline run.
Route quickly
- Read data-formats.md before choosing a class,
file layout, preprocessing callback, or array shape.
- Read api-reference.md for constructor and
return contracts, including classes that are importable only from their
defining module in this release.
- Read workflows.md for local-only validation,
preprocessing, and metric recipes.
- Read troubleshooting.md when a constructor
tries to download, an optional dependency is absent, or a metric returns an
unexpected value.
- Run check_dataset_contract.py with
--help first. Use its dataset checks against a user-supplied local
directory; it never downloads or instantiates a network-capable dataset
class.
Safe operating procedure
- Identify the dataset class and its exact raw or processed file contract.
- Obtain permission/licensing for the dataset independently. Do not fabricate
a fixture as a substitute for a licensed benchmark.
- Put data in a user-controlled directory and validate it with the bundled
checker. Use
--no-network (the default) and fix structural failures first.
- If the class has a local-path constructor, pass
dirpath explicitly. A
path argument does not imply offline behavior for classes whose constructor
still downloads missing files.
- Apply the documented preprocessing callback, retaining feature names and
target alignment. Record any row filtering, sentinel conversion, encoding,
normalization, or split seed.
- Before evaluating an explanation, make
x, coefs, and base refer to the
same feature order and length. For a sparse explanation, zero-fill a full
coefficient vector rather than passing only selected weights.
- Evaluate one row at a time with a model exposing
predict_proba. Check
finite outputs and interpretation direction before aggregating cases.
Dataset decision points
- Use HELOC, COMPAS, Adult, and MEPS for tabular CSV workflows; their
constructors expect fixed filenames and generally fail rather than infer a
different layout.
- Use TED when a deterministic packaged synthetic CSV is sufficient. Its
load_file contract separates feature columns, Y, and E.
- Use MNIST, Fashion-MNIST, CIFAR, or CelebA for image workflows only when the
required local files and framework dependencies are already available.
- Use Ford, Sunspot, or Climate for time-series workflows; preserve the
returned sequence/window conventions instead of flattening silently.
- Use CDC only when the NHANES XPT files, conversion dependency, and data-use
expectations are understood. Its constructor performs a multi-file download
when files are missing.
- Use eSNLI only with a local JSONL file at the class's expected location; the
class has no
dirpath parameter in this release.
Metric guardrails
faithfulness_metric(model, x, coefs, base) returns a scalar correlation-like
score. It removes each feature by replacing it with base and compares the
resulting predicted-class probabilities with coefs; higher positive values
are generally better, but constant inputs can produce nan.
monotonicity_metric(model, x, coefs, base) returns a boolean. It starts at
base, adds features in ascending signed coefficient order, and requires
predicted-class probabilities to be non-decreasing. This is not an absolute-
importance sort and is not a global model monotonicity proof.
Both functions use model.predict_proba, select the class predicted on x,
and reshape x to one row. They are local diagnostics, not causal or fairness
claims. See api-reference.md for exact details.
Boundaries
This route does not fit a classifier, train a neural network, call an explainer,
or reproduce a full notebook. Hand those tasks to the relevant algorithm
sub-skill. Dataset downloads, license forms, external R/SPSS conversion, large
archives, and GPU/framework setup are documented limitations; the bundled
checker provides a no-network structural alternative, not a downloader.
1---2name: datasets-and-metrics-23description: "Guides AIX360 dataset acquisition, local-path validation,4 preprocessing contracts, explanation-quality metrics, and offline5 troubleshooting for HELOC, COMPAS, CDC, MEPS, Ford, Sunspots, CIFAR, MNIST,6 CelebA, eSNLI, and related datasets."7disable-model-invocation: true8metadata:9 source: https://skillmd.com/skills/vectorspacelab/datasets-and-metrics-210 disco-role: operating11license: Apache 2.012---1314# AIX360 datasets and metrics1516Use this route when the task involves an AIX360 dataset, a local data directory,17preprocessing, faithfulness, monotonicity, or explanation-quality checks. It18covers data contracts and evaluation inputs; route model fitting, explainer19construction, and explanation generation to the algorithm-owning sub-skill.20Do not treat the dataset classes as download managers in an offline run.2122## Route quickly2324- Read [data-formats.md](references/data-formats.md) before choosing a class,25 file layout, preprocessing callback, or array shape.26- Read [api-reference.md](references/api-reference.md) for constructor and27 return contracts, including classes that are importable only from their28 defining module in this release.29- Read [workflows.md](references/workflows.md) for local-only validation,30 preprocessing, and metric recipes.31- Read [troubleshooting.md](references/troubleshooting.md) when a constructor32 tries to download, an optional dependency is absent, or a metric returns an33 unexpected value.34- Run [check_dataset_contract.py](scripts/check_dataset_contract.py) with35 `--help` first. Use its dataset checks against a user-supplied local36 directory; it never downloads or instantiates a network-capable dataset37 class.3839## Safe operating procedure40411. Identify the dataset class and its exact raw or processed file contract.422. Obtain permission/licensing for the dataset independently. Do not fabricate43 a fixture as a substitute for a licensed benchmark.443. Put data in a user-controlled directory and validate it with the bundled45 checker. Use `--no-network` (the default) and fix structural failures first.464. If the class has a local-path constructor, pass `dirpath` explicitly. A47 path argument does not imply offline behavior for classes whose constructor48 still downloads missing files.495. Apply the documented preprocessing callback, retaining feature names and50 target alignment. Record any row filtering, sentinel conversion, encoding,51 normalization, or split seed.526. Before evaluating an explanation, make `x`, `coefs`, and `base` refer to the53 same feature order and length. For a sparse explanation, zero-fill a full54 coefficient vector rather than passing only selected weights.557. Evaluate one row at a time with a model exposing `predict_proba`. Check56 finite outputs and interpretation direction before aggregating cases.5758## Dataset decision points5960- Use HELOC, COMPAS, Adult, and MEPS for tabular CSV workflows; their61 constructors expect fixed filenames and generally fail rather than infer a62 different layout.63- Use TED when a deterministic packaged synthetic CSV is sufficient. Its64 `load_file` contract separates feature columns, `Y`, and `E`.65- Use MNIST, Fashion-MNIST, CIFAR, or CelebA for image workflows only when the66 required local files and framework dependencies are already available.67- Use Ford, Sunspot, or Climate for time-series workflows; preserve the68 returned sequence/window conventions instead of flattening silently.69- Use CDC only when the NHANES XPT files, conversion dependency, and data-use70 expectations are understood. Its constructor performs a multi-file download71 when files are missing.72- Use eSNLI only with a local JSONL file at the class's expected location; the73 class has no `dirpath` parameter in this release.7475## Metric guardrails7677`faithfulness_metric(model, x, coefs, base)` returns a scalar correlation-like78score. It removes each feature by replacing it with `base` and compares the79resulting predicted-class probabilities with `coefs`; higher positive values80are generally better, but constant inputs can produce `nan`.8182`monotonicity_metric(model, x, coefs, base)` returns a boolean. It starts at83`base`, adds features in ascending **signed** coefficient order, and requires84predicted-class probabilities to be non-decreasing. This is not an absolute-85importance sort and is not a global model monotonicity proof.8687Both functions use `model.predict_proba`, select the class predicted on `x`,88and reshape `x` to one row. They are local diagnostics, not causal or fairness89claims. See [api-reference.md](references/api-reference.md) for exact details.9091## Boundaries9293This route does not fit a classifier, train a neural network, call an explainer,94or reproduce a full notebook. Hand those tasks to the relevant algorithm95sub-skill. Dataset downloads, license forms, external R/SPSS conversion, large96archives, and GPU/framework setup are documented limitations; the bundled97checker provides a no-network structural alternative, not a downloader.