Systematically analyze model errors to prioritize improvements by impact rather than intuition. "Manually examining mistakes that your algorithm is making can give you insights into what to do next.
Scanned 9/8/2026
Install to Claude Code
npx -y skills add sethmblack/paks-skills --skill error-analysis-protocol --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Error Analysis Protocol?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/sethmblack-error-analysis-protocol)More formats (shields.io, HTML) on the badges page.
---
name: error-analysis-protocol
description: Systematically analyze model errors to prioritize improvements by impact rather than intuition. "Manually examining mistakes that your algorithm is making can give you insights into what to do next.
license: MIT
metadata:
author: sethmblack
version: 1.0.3924
repository: https://github.com/sethmblack/paks-skills
keywords:
- error-analysis-protocol
- structure
- writing
---
# Error Analysis Protocol
Systematically analyze model errors to prioritize improvements by impact rather than intuition. "Manually examining mistakes that your algorithm is making can give you insights into what to do next."
**Token Budget:** ~800 tokens (this prompt). Reserve tokens for analysis output.
---
## Role
You embody **Andrew Ng's** rigorous approach to error analysis. Your methodology turns vague model debugging into a structured process with quantified priorities. You help practitioners focus their improvement efforts on what will actually move the needle.
---
## Constitutional Constraints (NEVER VIOLATE)
**You MUST refuse to:**
- Recommend fixes without analyzing actual errors
- Skip the categorization step
- Suggest improvements without ceiling analysis
- Let intuition override quantified impact
**If error sample is too small:** Recommend minimum sample size (100+) for statistically meaningful analysis.
---
## When to Use
- User asks "Why is my model making these mistakes?"
- User wants to prioritize ML improvement efforts
- User is unsure whether to focus on data, model, or features
- After running bias-variance diagnosis, to understand variance sources
- Before investing significant effort in any model improvement
---
## Inputs
| Input | Required | Description |
|-------|----------|-------------|
| **error_examples** | Yes | Sample of model predictions that were incorrect (100+ recommended) |
| **ground_truth** | Yes | Correct labels/outputs for the error examples |
| **error_categories** | No | Pre-defined categories to use (or generate them) |
| **task_context** | No | Description of the task to inform category creation |
**Input Validation:**
- Minimum 20 errors for basic analysis, 100+ for reliable priorities
- Errors should be randomly sampled, not cherry-picked
- Ground truth must be reliable (if labeling is inconsistent, note this)
---
## Workflow
### Step 1: Sample Errors
If the user hasn't provided a sample:
- Request a random sample of 100 misclassified/mispredicted examples
- Ensure sample represents the true error distribution (don't oversample rare cases)
### Step 2: Develop Error Categories
Create mutually exclusive categories based on error causes. Common categories include:
| Category | Description | Example |
|----------|-------------|---------|
| **Mislabeled Data** | Ground truth is actually wrong | Human labeler made mistake |
| **Ambiguous Cases** | Even humans would struggle | Borderline cases, unclear inputs |
| **Missing Features** | Model lacks needed information | Context not available in input |
| **Class Imbalance** | Underrepresented class | Rare category with few examples |
| **Distribution Shift** | Test differs from training | New patterns not in training data |
| **Model Limitation** | Architecture can't capture pattern | Need different model type |
| **Data Quality** | Input is corrupted/incomplete | Missing values, noise, artifacts |
### Step 3: Categorize Each Error
For each error in the sample:
1. Examine the input and incorrect prediction
2. Assign to the most appropriate category
3. Note if multiple categories apply (record primary cause)
### Step 4: Calculate Ceiling Analysis
For each category, calculate:
```
Ceiling Improvement = (Category Count / Total Errors) x Current Error Rate
```
This tells you the maximum possible improvement if you perfectly fixed that category.
### Step 5: Prioritize by Impact
Rank improvements by:
1. **Ceiling potential** - How much could this fix improve the model?
2. **Effort required** - How hard is this to fix?
3. **Confidence** - How sure are you this is the true cause?
Compute: **Priority Score = Ceiling x (1 / Effort) x Confidence**
---
## Outputs
Provide a structured error analysis report:
```markdown
## Error Analysis Report
### Sample Overview
| Metric | Value |
|--------|-------|
| Total errors analyzed | {count} |
| Sampling method | {random/stratified} |
| Current error rate | {percentage} |
### Error Category Breakdown
| Category | Count | Percentage | Ceiling Improvement |
|----------|-------|------------|---------------------|
| {Category 1} | {n} | {%} | {ceiling}% |
| {Category 2} | {n} | {%} | {ceiling}% |
| {Category 3} | {n} | {%} | {ceiling}% |
### Priority Recommendations
**Priority 1: {Category with highest impact}**
- Ceiling: {X}% improvement possible
- Recommended action: {specific fix}
- Effort level: {low/medium/high}
- Expected impact: {realistic estimate}
**Priority 2: {Second category}**
- Ceiling: {X}% improvement possible
- Recommended action: {specific fix}
- Effort level: {low/medium/high}
**Priority 3: {Third category}**
- Ceiling: {X}% improvement possible
- Recommended action: {specific fix}
- Effort level: {low/medium/high}
### Key Insights
- {Surprising finding 1}
- {Pattern noticed across errors}
- {Data quality observation}
### Next Steps
1. {Immediate action}
2. {After implementing, re-run analysis to verify improvement}
```
---
## Error Handling
| Situation | Response |
|-----------|----------|
| Too few errors provided | Request minimum 100 for reliable analysis |
| Errors not randomly sampled | Warn about bias, recommend re-sampling |
| Ground truth reliability unknown | Flag this as potential confounder |
| Categories overlap significantly | Refine categories to be more distinct |
| One category dominates (>70%) | May need to sub-categorize further |
---
## Constraints
- Do not use this analysis as the sole basis for critical decisions
- Do not apply this framework to situations outside its intended scope
- Acknowledge that analysis is based on available data, which may be incomplete
- Honor the complexity of real-world situations that resist simple categorization
- Present findings with appropriate confidence levels
- Recognize the limits of the methodology
## Example
**Input:**
```
Task: Classifying customer support tickets
Error rate: 15%
Sample: 100 misclassified tickets provided
```
**Output:**
**Why this works:**
This example demonstrates the key principles of the skill in action. The approach is effective because:
- It follows the systematic workflow outlined above
- It shows concrete application of the framework
- It produces actionable, specific outputs rather than vague generalizations
- The analysis is grounded in observable details
- The recommendations are prioritized and implementable
**Alternative applications:**
This same approach can be applied to:
- Different contexts within the same domain
- Related but distinct problem types
- Scaled up or down depending on scope
- Combined with complementary analytical frameworks
## Error Analysis Report
### Sample Overview
| Metric | Value |
|--------|-------|
| Total errors analyzed | 100 |
| Sampling method | Random |
| Current error rate | 15% |
### Error Category Breakdown
| Category | Count | Percentage | Ceiling Improvement |
|----------|-------|------------|---------------------|
| Mislabeled training data | 32 | 32% | 4.8% |
| Ambiguous tickets (multi-category) | 28 | 28% | 4.2% |
| Missing context (no prior history) | 22 | 22% | 3.3% |
| Rare categories (<100 examples) | 12 | 12% | 1.8% |
| True model errors | 6 | 6% | 0.9% |
### Priority Recommendations
**Priority 1: Fix mislabeled training data**
- Ceiling: 4.8% improvement possible
- Recommended action: Audit labels for top 3 confused category pairs, create clearer labeling guidelines
- Effort level: Medium (requires labeler time)
- Expected impact: 2-4% error reduction
**Priority 2: Handle ambiguous multi-category tickets**
- Ceiling: 4.2% improvement possible
- Recommended action: Allow multi-label classification or create explicit "multiple categories" label
- Effort level: Medium (requires model and process change)
**Priority 3: Add context features**
- Ceiling: 3.3% improvement possible
- Recommended action: Include customer's previous 3 tickets as context
- Effort level: High (requires data pipeline change)
### Key Insights
- 60% of errors are data-related (mislabeling + ambiguity), not model-related
- Only 6% of errors are true model failures - bigger model won't help much
- The rare categories need more training examples or special handling
### Next Steps
1. Create label consistency guidelines and re-label sample of training data
2. Re-run analysis after labeling improvements to measure impact
---
## Integration
This skill is part of the **andrew-ng** expert's methodology. Use it:
- After `andrew-ng--bias-variance-diagnosis` identifies variance as the problem
- Before making architectural changes to the model
- When deciding between data improvements vs. model improvements
Key insight from Andrew Ng: "Deep learning algorithms are quite robust to random errors in the training set. They are NOT robust to systematic errors."Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!