算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
fairlearn【设计与创意】Use Fairlearn to assess group fairness, compute disparity metrics, visualize subgroup performance, and mitigate unfairness with preprocessing, reductions, postprocessing, or adversarial learning.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this repo skill when a task names fairlearn, asks for the Fairlearn Python package, or uses Fairlearn vocabulary such as MetricFrame, sensitive_features, demographic parity, equalized odds, CorrelationRemover, ExponentiatedGradient, GridSearch, ThresholdOptimizer, AdversarialFairnessClassifier, or Fairlearn dataset fetchers.
Fairlearn is API-first. This checkout does not define a Fairlearn-specific command-line interface, so route future agents to Python APIs, bundled references, and the smoke scripts in this skill.
For normal package use:
python -m pip install fairlearn
Add optional plotting and adversarial-learning dependencies only when the workflow needs them:
python -m pip install matplotlib # group plots and threshold-optimizer plots
python -m pip install torch # PyTorch adversarial backend
# TensorFlow is an alternative adversarial backend, but was not verified in this skill run.
From this skill directory, run the bundled root check when you need a safe import and optional-backend smoke test:
python scripts/check_install.py --include-optional
Read references/installation.md for version and optional dependency details, references/troubleshooting.md for cross-cutting failures, and references/repo-provenance.md before deciding whether this skill is stale for a newer Fairlearn checkout.
| Task signal | Read this sub-skill | Why |
|---|---|---|
Group metrics, MetricFrame, selection_rate, demographic parity/equalized odds metrics, intersections, bootstrapped confidence intervals, model comparison plots, ROC-by-group plots | sub-skills/assessment/SKILL.md | Assessment owns Fairlearn metrics, grouped outputs, CIs, and plotting helpers. |
Remove linear correlation with sensitive columns, fair representation learning, CorrelationRemover, PrototypeRepresentationLearner, preprocessing before a downstream estimator | sub-skills/preprocessing/SKILL.md | Preprocessing owns transformations applied before model training. |
Fairness-constrained training with sklearn-compatible estimators, ExponentiatedGradient, GridSearch, DemographicParity, EqualizedOdds, BoundedGroupLoss, sample_weight_name | sub-skills/reductions/SKILL.md | Reductions owns algorithms that reduce fairness constraints to weighted supervised-learning problems. |
Adjust a trained predictor with group-specific thresholds, ThresholdOptimizer, plot_threshold_optimizer, prefit, predict_method, post-fit parity constraints | sub-skills/postprocessing/SKILL.md | Postprocessing owns prediction-time threshold/interpolation mitigation. |
Neural adversarial fairness, PyTorch or TensorFlow backends, callbacks, CUDA, AdversarialFairnessClassifier, AdversarialFairnessRegressor | sub-skills/adversarial/SKILL.md | Adversarial workflows have backend-specific model, optimizer, and training pitfalls. |
Built-in datasets, fetch_adult, fetch_acs_income, fetch_boston, return_X_y, as_frame, data_home, dataset fairness caveats | sub-skills/datasets/SKILL.md | Dataset loaders have network/cache behavior and dataset-specific schemas. |
Installing, checking versions, optional extras, missing matplotlib/torch/tensorflow, show_versions, import/runtime diagnostics | sub-skills/installation/SKILL.md | Installation owns environment and dependency recovery paths. |
X, y_true/y, predictions, and sensitive_features must describe the same samples in the same order.sensitive_features for group definitions even when those columns are also present in X. Do not assume ignoring sensitive features is enough to assess or mitigate unfairness.references/fairness-framing.md summarizes Fairlearn's group-fairness framing, sensitive features, parity constraints, disparity metrics, and limits.references/installation.md covers install commands, optional dependencies, import checks, and version inspection.references/troubleshooting.md covers package-wide import, plotting, backend, data-shape, and stale-version failures.references/repo-provenance.md records source revision, package version, evidence paths, backend verification, and refresh signals.references/repo-routing-metadata.json is structured metadata consumed by DisCo's managed repo-skills router import transaction.scripts/check_install.py validates the installed Fairlearn package, stable public submodules, and optional plotting/adversarial dependencies.