hung-phan/ml-skills/evaluation-patterns
Claude Code and agent skill by hung-phan/ml-skills
- community
Checking that the SKILL.md file is still in the repository.
Test case and evaluation harness design for DSPy optimization. Use when constructing dspy.Example datasets, designing LLM-as-judge metrics, or structuring train/val splits.
Install
npx vskill@latest install hung-phan/ml-skills/evaluation-patternsSKILL.md
The same SKILL.md was published earlier as hung-phan/ml-skills/evaluation-patterns.
Evaluation Patterns
Why This Exists
Problem: Knowing whether your DSPy program improved after optimization requires evaluating on a held-out devset with the right metric — without this you're flying blind and may be overfit to the trainset or regressed on edge cases.
Key insight: dspy.Example separates what the module receives (inputs) from what the metric compares against (gold labels) using with_inputs(), making it the atomic unit for both training and evaluation.
Reach for this when: You need to construct a trainset or devset for DSPy, design an LLM-as-judge metric, or run a before/after comparison to validate an optimizer's effect.
Evaluation Approach Comparison
| Approach | Metric type | Cost | When to use | |
|---|---|---|---|---|
| Exact match / token F1 | bool or float | Cheap | Factoid QA, entity extraction | |
| Rule-based composite | float | Cheap | Format + content checks | |
| LLM-as-judge | float | Medium | Open-ended generation, semantic quality | |
| Multi-dimensional LLM judge | Prediction(score, feedback) | Medium | GEPA optimization |
dspy.Example Construction
Key rule: with_inputs() separates what the module sees (input) from what metrics compare against (gold).
Test Case Taxonomy
Single-turn
Multi-turn
Edge cases
LLM-as-Judge Pattern
Multi-Dimensional Scoring
Evaluate Harness
Gotchas
- Minimum 6-8 examples for MIPROv2 — fewer and bootstrapping fails
- 20 diverse cases > 50 similar cases
- Gold context should be concise — judges compare semantics not wording
- Use a stronger model as judge than the target model
with_inputs()is required — without it DSPy doesn't know input vs gold
References
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ml-review/references/ml-libraries/dspy/evaluation-patterns/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hung-phan/ml-skills/evaluation-patterns)