# Median Proximity Coreset

> Select Moderate-DS coresets by keeping examples whose scalar scores are closest to the score median.

- Skill: `yzj623/median-proximity-coreset` (Agent Skill)
- Install (CLI): `npx get-skill add yzj623/median-proximity-coreset`
- Raw SKILL.md: https://api.skillmd.com/api/skills/yzj623/median-proximity-coreset/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: yzj623 (https://skillmd.com/u/yzj623)
- Updated: 2026-11-19
- Page: https://skillmd.com/skills/yzj623/median-proximity-coreset

---


# Median Proximity Coreset

Use this skill after scores have been computed for candidate examples. It implements the paper's moderate coreset rule: sort by closeness to the score median rather than selecting the smallest or largest scores. Do not use this skill to compute representation scores or to claim downstream performance.

## Inputs
- A list of score records containing `id` and numeric `score`.
- Either an integer `size` or a ratio convertible to a target size by the caller.

## Outputs
- Selected ids.
- The median score.
- Ranked proximity diagnostics with deterministic tie-breaking.

## Workflow
1. Validate all scores and requested size.
2. Compute the conventional median of all scores.
3. Rank records by absolute distance to the median, then by score and id for deterministic ties.
4. Return exactly the requested number of selected ids.

## Validation
Run `python scripts/select_median_coreset.py --self-test`. Tests include even medians, stable ties, and invalid sizes.

## Limitations
The skill operates on scalar scores only. A future run should combine it with a scoring skill and an evaluation skill for complete Moderate-DS recovery.

