Skip to content
Back to skills

Ce Mondrian Conditional

ASecurity

Configure and validate Mondrian and conditional calibration for subgroup-aware uncertainty and fairness-sensitive workflows.

  • 30 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 12, 2026
ai-agentsgospring

Security analysis

A100/100

Scanned November 12, 2026

npx -y skills add majiayu000/claude-skill-registry-data --skill ce-mondrian-conditional --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ce Mondrian Conditional?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ce Mondrian Conditional
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-ce-mondrian-conditional-claude-skill-registry-data/badge)](https://www.skillsdirectory.com/skills/majiayu000-ce-mondrian-conditional-claude-skill-registry-data)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ce-mondrian-conditional
description: >
  Configure and validate Mondrian and conditional calibration for subgroup-aware
  uncertainty and fairness-sensitive workflows.
---

# CE Mondrian Conditional

You are setting up Mondrian (conditional) calibration, which partitions
calibration data into subgroups so that each group receives its own
uncertainty estimate. This reveals group-specific prediction quality and is
the foundational technique for fairness-aware deployments in CE.

**Research**: [Conditional Calibrated Explanations (xAI 2024)](https://link.springer.com/chapter/10.1007/978-3-031-63787-2_17)

Load `references/mondrian_examples.md` for full code examples (Options A/B/C,
fairness analysis, global vs conditional comparison).

---

## Why Mondrian matters for fairness

Without conditional calibration, the CPS/Venn-Abers calibrator averages over
all calibration instances. A minority group with harder prediction patterns
may receive the same interval width as an easy majority group, hiding bias.

Mondrian splits calibration by a grouping key and fits a separate calibrator
per bin. Resulting intervals are:
- **Narrower** for groups the model predicts reliably.
- **Wider** for groups the model predicts poorly.

---

## Three options for specifying bins

- **Option A — Inline `bins` array**: pass integer group labels directly at calibrate time.
- **Option B — `MondrianCategorizer`** (recommended for continuous features): auto-bins
  via `crepes.extras.MondrianCategorizer`.
- **Option C — Lambda as `mc`**: pass a callable directly for ad-hoc one-off scripts.

---

## Calibration -> predict -> explain consistency rules

| Step | Bins argument |
|---|---|
| `calibrate(...)` | `mc=` (MondrianCategorizer or callable) OR `bins=` (integer array) |
| `predict(x, ...)` | nothing if `mc` was used at calibrate time OR `bins=group_labels_test` |
| `predict_proba(x, ...)` | same as above |
| `explain_factual(x, ...)` | same as above |
| `explore_alternatives(x, ...)` | same as above |

**CRITICAL**: always pass `bins=` at inference time whenever the explainer
was calibrated with Mondrian bins. Omitting it silently falls back to global
calibration, which defeats fairness analysis.

---

## Minimum bin size warning

Mondrian calibration splits the calibration set by group. Too few samples
per bin leads to unreliable or very wide intervals.

> **Rule of thumb**: aim for >= 30-50 calibration samples per bin.

---

## Out of Scope

- DifficultyEstimator (per-instance sigma scaling for regression; see `ce-regression-intervals`).
- Reject policies (deciding whether to defer uncertain predictions; see `ce-reject-policy`).
- Fairness constraint enforcement (CE reveals uncertainty; it does not enforce fairness automatically).

## Evaluation Checklist

- [ ] Group labels at explain/predict time match the label space used at calibrate time.
- [ ] Minimum bin size verified (>= 30 samples per bin recommended).
- [ ] Both `calibrate(mc=...)` and `explain_factual(bins=...)` consistently use the same categorizer.
- [ ] If comparing global vs Mondrian: separate `WrapCalibratedExplainer` instances used.
- [ ] Per-group interval widths inspected to surface differential uncertainty.
- [ ] Coverage rate verified per group (not just pooled).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.