AGENT SKILL

assessment

Use Fairlearn assessment APIs for MetricFrame, group fairness metrics, bootstrapped confidence intervals, model comparison, and subgroup plots.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
assessment
license
MIT
metadata
{ "disco-role": "operating" }
description
Use Fairlearn assessment APIs for MetricFrame, group fairness metrics, bootstrapped confidence intervals, model comparison, and subgroup plots.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Fairlearn assessment

Use this sub-skill when the task is about assessing model behavior across groups: MetricFrame, sensitive_features, group metrics, demographic parity/equalized odds metrics, intersections, control features, confidence intervals, plot_model_comparison, plot_roc_curve_by_group, or the experimental plot_metric_frame helper.

Quick workflow

  1. Align y_true, y_pred or scores, and sensitive_features row-for-row.
  2. Choose overall utility metrics and fairness-sensitive group metrics before mitigation.
  3. Build a MetricFrame with a metric callable or a metric dictionary.
  4. Inspect overall, by_group, group_min(), group_max(), difference(), and ratio().
  5. For uncertainty, set both n_boot and ci_quantiles; if either is set alone Fairlearn raises a bootstrap parameter error.
  6. For plots, confirm matplotlib is installed, then use pandas plotting, plot_roc_curve_by_group, plot_model_comparison, or the experimental plot_metric_frame import path.

Read these references

Core APIs to recognize

  • fairlearn.metrics.MetricFrame
  • Base metrics: selection_rate, count, true_positive_rate, true_negative_rate, false_positive_rate, false_negative_rate, mean_prediction
  • Fairness metrics: demographic_parity_difference, demographic_parity_ratio, equalized_odds_difference, equalized_odds_ratio, equal_opportunity_difference, equal_opportunity_ratio
  • Dynamic helpers: make_derived_metric, generated <metric>_{difference,ratio,group_min,group_max} functions
  • Plots: plot_model_comparison, plot_roc_curve_by_group, and plot_metric_frame from fairlearn.experimental.enable_metric_frame_plotting

Boundary rules

  • This sub-skill owns assessment only. If the user asks how to change the model, route to preprocessing, reductions, postprocessing, or adversarial after summarizing the assessment target.
  • This sub-skill can evaluate any sklearn-compatible model's predictions; it does not require Fairlearn mitigation algorithms.
  • Dataset fetchers are owned by ../datasets/; use this sub-skill only after the data is loaded and predictions/scores are available.
  • Plot dependency diagnosis starts here for assessment plots, but package-wide install recovery lives in ../../references/troubleshooting.md and ../installation/.

Operating rules

  • Always name the sensitive features and their intended grouping semantics in the report.
  • Do not report a single fairness metric as a final fairness verdict. Include overall utility, subgroup metrics, and context limitations.
  • Use control_features when comparing sensitive-feature disparities within slices such as model version, region, or time bucket.
  • For multiple sensitive features, prefer a pandas DataFrame with named columns so group/intersection labels are intelligible.
  • For custom metrics that need sample_weight or other side inputs, pass sample_params with the same row alignment as y_true and y_pred.
  • In headless environments set MPLBACKEND=Agg or call matplotlib.use("Agg") before plotting.

Fast validation

Run a no-network smoke check:

python sub-skills/assessment/scripts/smoke_assessment.py

Run plot coverage in a matplotlib-capable environment:

python sub-skills/assessment/scripts/smoke_assessment.py --plot --output-dir /tmp/fairlearn-assessment-plots

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351