fairlearn-bias-detector

Fairness assessment skill using Fairlearn for bias detection, mitigation, and compliance reporting.

509 stars

Best use case

fairlearn-bias-detector is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Fairness assessment skill using Fairlearn for bias detection, mitigation, and compliance reporting.

Teams using fairlearn-bias-detector should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/fairlearn-bias-detector/SKILL.md --create-dirs "https://raw.githubusercontent.com/a5c-ai/babysitter/main/library/specializations/data-science-ml/skills/fairlearn-bias-detector/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/fairlearn-bias-detector/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How fairlearn-bias-detector Compares

Feature / Agentfairlearn-bias-detectorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Fairness assessment skill using Fairlearn for bias detection, mitigation, and compliance reporting.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# fairlearn-bias-detector

## Overview

Fairness assessment skill using Fairlearn for bias detection, mitigation, and compliance reporting in ML models.

## Capabilities

- Demographic parity assessment
- Equalized odds evaluation
- Disparity metrics calculation
- Bias mitigation algorithms (preprocessing, in-processing, post-processing)
- Fairness constraint optimization
- Compliance documentation generation
- Intersectional fairness analysis
- Threshold optimization for fairness

## Target Processes

- Model Evaluation and Validation Framework
- Model Interpretability and Explainability Analysis
- A/B Testing Framework for ML Models

## Tools and Libraries

- Fairlearn
- scikit-learn
- pandas

## Input Schema

```json
{
  "type": "object",
  "required": ["modelPath", "dataPath", "sensitiveFeatures"],
  "properties": {
    "modelPath": {
      "type": "string",
      "description": "Path to the trained model"
    },
    "dataPath": {
      "type": "string",
      "description": "Path to evaluation data"
    },
    "sensitiveFeatures": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Column names of sensitive attributes"
    },
    "labelColumn": {
      "type": "string",
      "description": "Name of the target/label column"
    },
    "assessmentConfig": {
      "type": "object",
      "properties": {
        "metrics": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": ["demographic_parity", "equalized_odds", "true_positive_rate", "false_positive_rate", "accuracy"]
          }
        },
        "threshold": { "type": "number" }
      }
    },
    "mitigationConfig": {
      "type": "object",
      "properties": {
        "method": {
          "type": "string",
          "enum": ["threshold_optimizer", "exponentiated_gradient", "grid_search", "reductions"]
        },
        "constraint": { "type": "string" },
        "gridSize": { "type": "integer" }
      }
    }
  }
}
```

## Output Schema

```json
{
  "type": "object",
  "required": ["status", "assessment"],
  "properties": {
    "status": {
      "type": "string",
      "enum": ["success", "error"]
    },
    "assessment": {
      "type": "object",
      "properties": {
        "overallMetrics": { "type": "object" },
        "groupMetrics": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "group": { "type": "string" },
              "count": { "type": "integer" },
              "metrics": { "type": "object" }
            }
          }
        },
        "disparityMetrics": {
          "type": "object",
          "properties": {
            "demographicParityDiff": { "type": "number" },
            "equalizedOddsDiff": { "type": "number" }
          }
        },
        "fairnessScore": { "type": "number" }
      }
    },
    "mitigation": {
      "type": "object",
      "properties": {
        "method": { "type": "string" },
        "improvedModel": { "type": "string" },
        "beforeMetrics": { "type": "object" },
        "afterMetrics": { "type": "object" }
      }
    },
    "complianceReport": {
      "type": "string",
      "description": "Path to generated compliance report"
    }
  }
}
```

## Usage Example

```javascript
{
  kind: 'skill',
  title: 'Assess model fairness',
  skill: {
    name: 'fairlearn-bias-detector',
    context: {
      modelPath: 'models/loan_model.pkl',
      dataPath: 'data/test.csv',
      sensitiveFeatures: ['gender', 'race'],
      labelColumn: 'approved',
      assessmentConfig: {
        metrics: ['demographic_parity', 'equalized_odds'],
        threshold: 0.8
      },
      mitigationConfig: {
        method: 'threshold_optimizer',
        constraint: 'demographic_parity'
      }
    }
  }
}
```

Related Skills

homoglyph-detector

509
from a5c-ai/babysitter

Byte-level Unicode homoglyph detection for identifying invisible character substitutions in code

geant4-detector-simulator

509
from a5c-ai/babysitter

Geant4 detector simulation skill for particle transport, detector geometry, and physics process modeling

structural-variant-detector

509
from a5c-ai/babysitter

Structural variant detection skill for identifying CNVs, inversions, translocations, and complex rearrangements

fusion-gene-detector

509
from a5c-ai/babysitter

Gene fusion detection skill for oncology applications with multiple caller integration

memory-leak-detector

509
from a5c-ai/babysitter

Detect memory leaks in desktop applications through heap analysis and object tracking

evidently-drift-detector

509
from a5c-ai/babysitter

Evidently AI skill for data drift detection, model performance monitoring, target drift analysis, and automated reporting for ML systems in production.

code-smell-detector

509
from a5c-ai/babysitter

Automated detection of code smells and anti-patterns to identify refactoring opportunities

terminal-capability-detector

509
from a5c-ai/babysitter

Detect terminal capabilities including color support, TTY status, size, and Unicode support for adaptive CLI output.

prompt-injection-detector

509
from a5c-ai/babysitter

Prompt injection detection and prevention for secure LLM applications

process-builder

509
from a5c-ai/babysitter

Scaffold new babysitter process definitions following SDK patterns, proper structure, and best practices. Guides the 3-phase workflow from research to implementation.

Workflow & Productivity

babysitter

509
from a5c-ai/babysitter

Orchestrate via @babysitter. Use this skill when asked to babysit a run, orchestrate a process or whenever it is called explicitly. (babysit, babysitter, orchestrate, orchestrate a run, workflow, etc.)

yolo

509
from a5c-ai/babysitter

Run Babysitter autonomously with minimal manual interruption.