majiayu000/claude-skill-registry-data/balanced-log-loss
Claude Code and agent skill by majiayu000/claude-skill-registry-data
- community
Checking that the SKILL.md file is still in the repository.
Author "majiayu000" has blocked skill(s)
Class-balanced log loss that weights each class by the inverse of its sample count, equalizing the contribution of minority and majority classes.
Install
npx vskill@latest install majiayu000/claude-skill-registry-data/balanced-log-lossSKILL.md
Balanced Log Loss
Overview
Standard log loss is dominated by the majority class — in a 90/10 split, the loss is 90% driven by class-0 predictions. Balanced log loss weights each class by 1/N_class, equalizing their contribution regardless of sample count. This is the correct metric when false negatives on the minority class are as costly as false positives on the majority class. Many Kaggle competitions with imbalanced binary targets use this as the official metric.
Quick Start
Workflow
- Clip predictions to avoid log(0)
- Compute log loss for each class separately
- Divide each class's loss by its sample count
- Average the two normalized losses
Key Decisions
- Clipping: 1e-15 is standard; prevents -inf from log(0)
- vs sample_weight: Equivalent to
log_loss(y, p, sample_weight=inverse_freq)but more explicit - Multiclass: Extend by weighting each of K classes by
1/N_k - Optimization: Train with class-weighted BCE to optimize for this metric directly
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 repositoryCheckingother/balanced-log-loss/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/majiayu000/claude-skill-registry-data/balanced-log-loss)