Skip to content
Back to skills

Weighted Position Decay Ensemble

ASecurity

Ensembles multiple ranked recommendation lists by scoring items as model_weight / position_rank, then re-ranking.

  • 61 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 12, 2026
toolspython

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add wenmin-wu/ds-skills --skill weighted-position-decay-ensemble --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Weighted Position Decay Ensemble?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Weighted Position Decay Ensemble
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/wenmin-wu-weighted-position-decay-ensemble/badge)](https://www.skillsdirectory.com/skills/wenmin-wu-weighted-position-decay-ensemble)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tabular-weighted-position-decay-ensemble
description: >
  Ensembles multiple ranked recommendation lists by scoring items as model_weight / position_rank, then re-ranking.
---
# Weighted Position Decay Ensemble

## Overview

When combining ranked lists from multiple recommendation models, score each item as `model_weight / (position + 1)`. Items appearing in multiple lists accumulate scores. Re-rank by total score to produce the final list. This naturally favors items ranked high by strong models while still crediting items from weaker ones.

## Quick Start

```python
def blend_recommendations(rec_lists, weights):
    """Blend multiple ranked recommendation lists.

    Args:
        rec_lists: list of lists, each a ranked recommendation
        weights: list of floats, per-model importance weight

    Returns:
        list of items sorted by blended score
    """
    scores = {}
    for recs, w in zip(rec_lists, weights):
        for rank, item in enumerate(recs):
            scores[item] = scores.get(item, 0) + w / (rank + 1)
    ranked = sorted(scores, key=scores.get, reverse=True)
    return ranked[:12]
```

## Workflow

1. Generate ranked recommendation lists from each model
2. Assign importance weight to each model (tune on validation)
3. Score each item: accumulate `weight / (rank + 1)` across models
4. Sort by total score, take top-K

## Key Decisions

- **Decay function**: `1/(rank+1)` is simple; `1/log2(rank+2)` is gentler (NDCG-like)
- **Weight tuning**: Optimize on MAP@K validation; can use Optuna
- **Multi-stage**: Blend top models first, then re-blend result with additional models
- **Deduplication**: Built-in — items accumulate scores naturally

## References

- H&M Personalized Fashion Recommendations (Kaggle)
- Source: [lb-0-0240-h-m-ensemble-magic-multi-blend](https://www.kaggle.com/code/tarique7/lb-0-0240-h-m-ensemble-magic-multi-blend)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…