Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add topprismdata/cultivating-ml-agent --skill kaggle-optimal-blendinggit clone --depth 1 https://github.com/topprismdata/cultivating-ml-agentWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/kaggle-optimal-blending)<a href="https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/kaggle-optimal-blending"><img src="https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/kaggle-optimal-blending/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/kaggle-optimal-blending"><img src="https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/kaggle-optimal-blending.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00161 | $0.01471 |
| Opus 5.5 | $0.00064 | $0.00588 |
| Sonnet 5.5 | $0.00032 | $0.00294 |
| Haiku 4.5 | $0.00016 | $0.00147 |
Grade A, and why
kaggle-optimal-blending scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 186 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Kaggle Optimal Blending: The 80/20 Rule
Problem
Re-ranking (k-reciprocal, Jaccard, etc.) is powerful but using 100% re-ranked results can lose valuable signal diversity. Equal-weight blending often underperforms.
Context / Trigger Conditions
Use when:
- Implementing post-processing for Re-ID, retrieval, or recommendation tasks
- Re-ranking alone doesn't give expected boost
- Ensemble of multiple models shows little improvement
- Kaggle score plateaus despite strong individual models
Solution
The 80/20 Optimal Blending Rule
Key insight from 0.938 mAP solution (Jaguar Re-ID):
blend_raw_ratio = 0.20 # 20% raw, 80% re-ranked
final_similarity = (
(1 - blend_raw_ratio) * rerank_score +
blend_raw_ratio * raw_score
)
Why 80/20?
- 80% re-ranking: Captures neighborhood structure, removes false positives
- 20% raw: Preserves genuine long-range similarities, maintains diversity
- This ratio emerged as optimal through experimentation (0.938 mAP)
Implementation
import numpy as np
def optimal_blend(similarity_matrix, reranked_matrix, raw_ratio=0.20):
"""
Blend re-ranked and raw similarity matrices
Args:
similarity_matrix: Original NxM similarity matrix
reranked_matrix: Re-ranked version (k-reciprocal, etc.)
raw_ratio: Weight for raw score (default 0.20)
Returns:
Blended similarity matrix
"""
return (1 - raw_ratio) * reranked_matrix + raw_ratio * similarity_matrix
Re-Ranking Parameters (Optimized for 0.938 mAP)
# k-Reciprocal Re-ranking parameters
k1 = 20 # First k for reciprocal neighbors
k2 = 6 # Second k for final re-ranking
lambda_param = 0.2 # Jaccard weight
Complete Post-Processing Pipeline
def post_process_for_reid(query_features, gallery_features):
"""
Complete post-processing: TTA + QE + Re-ranking + Optimal Blend
"""
# 1. TTA (Test Time Augmentation)
# query_features = (f_original + f_flipped) / 2
# 2. Query Expansion (optional)
# Expand with top-k gallery samples
qe_top_k = 3
# 3. Compute raw similarities
raw_sim = cosine_similarity(query_features, gallery_features)
# 4. Re-ranking (k-reciprocal)
reranked_sim = k_reciprocal_reranking(
raw_sim,
k1=k1,
k2=k2,
lambda_param=lambda_param
)
# 5. Optimal blending (THE KEY!)
final_sim = optimal_blend(
raw_sim,
reranked_sim,
raw_ratio=0.20 # Don't use 0.0 or 0.5!
)
return final_sim
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 186 lines · 161 tokens per session scan A 5db2a37e384a
kaggle-optimal-blending is a skill published in the GitHub repository topprismdata/cultivating-ml-agent (5 stars, last pushed 1mo ago), licensed MIT. It adds 161 tokens to every session and 1,471 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
kaggle-optimal-blending compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| kaggle-optimal-blendingtopprismdata/cultivating-ml-agent | Skill | 5 | 1mo ago | MIT | A | 161 | Claude Code, Codex |
| huggingface-hubbraxtonROSE4/zorro-agent | Skill | 11 | 7mo ago | MIT | C | 43 | Claude Code, Codex |
| agent-v3-memory-specialistruvnet/ruflo | Skill | 83k | today | MIT | A | 25 | Claude Code |
| agent-safla-neuralruvnet/ruflo | Skill | 83k | today | MIT | A | 24 | Claude Code |
| neural-trainingruvnet/ruflo | Skill | 83k | today | MIT | A | 64 | Claude Code |
| kv-cache-designbojieli/ai-agent-book | Skill | 60k | yesterday | Apache-2.0 | A | 91 | Claude Code, Codex |
| reward-designbojieli/ai-agent-book | Skill | 60k | yesterday | Apache-2.0 | A | 131 | Claude Code, Codex |