Skip to content
Back to skills

Cumulative Regret

ASecurity

Evaluates piecewise-stationary multi-armed bandit algorithms by measuring the expected cumulative regret over a sequence of time steps. It probes how well an algorithm adapts to changing arm reward distributions (change-points) while balancing exploration and exploitation. Use when the user has predictions and gold and needs to compute cumulative regret.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 11, 2026
researchpythongo

Works with

  • cli

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add qhjqhj00/research-skills-pool --skill cumulative-regret --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cumulative Regret?

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

Security grade badge for Cumulative Regret
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/qhjqhj00-cumulative-regret/badge)](https://www.skillsdirectory.com/skills/qhjqhj00-cumulative-regret)

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: cumulative-regret
description: Evaluates piecewise-stationary multi-armed bandit algorithms by measuring the expected cumulative regret over a sequence of time steps. It probes how well an algorithm adapts to changing arm reward distributions (change-points) while balancing exploration and exploitation. Use when the user has predictions and gold and needs to compute cumulative regret.
metadata:
  skill_kind: metric
  source_arxiv: 1802.03692
  bibtex_key: cao2018nearly
  confidence: high
---

# cumulative-regret

> Nearly Optimal Adaptive Procedure with Change Detection for Piecewise-Stationary Bandit — Cao et al. (2018) (arXiv:1802.03692, 2018)

## What this evaluates

Evaluates piecewise-stationary multi-armed bandit algorithms by measuring the expected cumulative regret over a sequence of time steps. It probes how well an algorithm adapts to changing arm reward distributions (change-points) while balancing exploration and exploitation.

## Datasets

- **Yahoo! Front Page Today Module User Click Log Dataset** — total ?; splits: test (432000); repo https://webscope.sandbox.yahoo.com

## Metrics

- `cumulative regret` **(primary)** — range: other
  - Expected cumulative regret is defined as E[sum_{t=1}^T (mu^*_t - mu_{A_t})], where mu^*_t is the mean reward of the optimal arm at time t, mu_{A_t} is the mean reward of the selected arm, and the expectation is averaged over 100 independent Monte Carlo trials.

## Input / output format

**Input**: At each time step t, the algorithm receives the current arm selection A_t and observes a binary reward (click/no-click) drawn from a piecewise-stationary Bernoulli distribution. The environment provides a sequence of T time steps with K arms.

**Output**: A single arm index A_t in {1, ..., K} selected at each time step t.

## Scoring recipe

```python
def compute_cumulative_regret(rewards, actions, T):
    regret = 0.0
    for t in range(T):
        best_arm_reward = max(rewards[t])
        chosen_arm_reward = rewards[t][actions[t]]
        regret += best_arm_reward - chosen_arm_reward
    return regret / 100  # Average over 100 Monte Carlo trials
```

## Common pitfalls

- The Yahoo dataset experiment uses small-magnitude change-points (<0.1) that violate the paper's theoretical assumption (requires ≥0.64), making the comparison theoretically inconsistent but practically relevant.
- Regret scaling experiments use synthetic data with fixed change-point intervals and specific parameter bounds, which may not reflect real-world non-stationarity patterns.
- The metric is averaged over 100 Monte Carlo trials, but standard deviations or confidence intervals are not explicitly reported in the figures.

## Evidence (verbatim from paper)

> The expected cumulative regret is computed by taking the average of the regrets for 100 independent Monte Carlo trials, as shown in Figure 4. We compare the expected cumulative regret of different algorithms using the benchmark dataset publicly published by Yahoo! ... This dataset provides a binary value for each arrival to represent whether the user clicks the specified article ... We use one arm to represent one article and assume a Bernoulli reward (one if the user clicks the article and zero otherwise).

## Citation

```bibtex
@misc{cao2018nearly,
  title={Nearly Optimal Adaptive Procedure with Change Detection for Piecewise-Stationary Bandit},
  author={Cao et al. (2018)},
  year={2018},
  note={arXiv:1802.03692}
}
```

- arXiv: 1802.03692

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.