wenmin-wu/ds-skills/class-balanced-epoch-undersampling
Claude Code and agent skill by wenmin-wu/ds-skills
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Dynamically undersample majority class each epoch with per-class keep probabilities for stochastic balance
Install
npx vskill@latest install wenmin-wu/ds-skills/class-balanced-epoch-undersamplingSKILL.md
Overview
Instead of fixed undersampling (which discards data permanently), resample at the start of each epoch using per-class keep probabilities. Negative samples are randomly dropped with probability p, so the model sees different negative subsets each epoch while maintaining approximate class balance. This preserves data diversity across epochs while controlling imbalance.
Quick Start
Workflow
- Define keep probabilities per class (e.g., negative=0.35, positive=0.5)
- At each epoch start, draw random numbers for all samples
- Keep sample if random draw < its class keep probability
- Shuffle surviving indices and train on this subset
- Next epoch gets a different random subset
Key Decisions
- Keep probabilities: Set lower for majority class. 0.35 for negatives with 0.5 for positives gives ~1.4:1 ratio from a 6:1 imbalanced set.
- vs. fixed undersampling: Fixed discards data permanently. Stochastic sees all data over multiple epochs.
- vs. oversampling: No duplicate samples, avoids overfitting to minority class. Works better with augmentation.
References
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cv/class-balanced-epoch-undersampling/SKILL.md
Popularity
- 7-day trend score
- 5
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/wenmin-wu/ds-skills/class-balanced-epoch-undersampling)