Datasets and metrics

From VectorSpaceLab/AREX-Skill · View interactive version

Datasets and metrics is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Use AIF360 legacy dataset containers and fairness metric classes for tabular protected-group analysis.

How to use this skill

Skill file

AIF360 datasets and metrics router

Use this sub-skill when the task is about AIF360's legacy dataset objects and metric classes: constructing StructuredDataset, BinaryLabelDataset, StandardDataset, or RegressionDataset instances; loading legacy raw-dataset wrappers; defining privileged/unprivileged protected groups; and computing dataset, classification, regression, sample-distortion, or MDSS classification metrics.

Read first

Fast routing

  1. In-memory legacy dataset: read data formats and build a numeric, NA-free pandas DataFrame; pass label_names, protected_attribute_names, and explicit favorable_label/unfavorable_label when labels are not 1.0/0.0.
  2. Built-in wrappers: read built-in dataset wrappers before calling AdultDataset, GermanDataset, CompasDataset, BankDataset, MEPSDataset19/20/21, or LawSchoolGPADataset; legacy wrappers are not safe smoke tests because public raw files may be absent or network-bound.
  3. Metric choice: use BinaryLabelDatasetMetric for one true dataset, ClassificationMetric for true-vs-predicted BinaryLabelDataset pairs, SampleDistortionMetric for original-vs-distorted StructuredDataset pairs, RegressionDatasetMetric for ranked regression datasets, and MDSSClassificationMetric only when a classification metric object must score a known group.
  4. Group definitions: create privileged_groups and unprivileged_groups as lists of dictionaries keyed by dataset.protected_attribute_names; the dictionary values must match the encoded numeric protected attributes.
  5. Smoke check: run the bundled no-data script with python scripts/metric_report_smoke.py --pretty from this sub-skill directory, or pass its path to a Python interpreter from another working directory.

Route away when appropriate

Minimal operating checklist

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.