h2seqrec-eval
Hyperbolic Hypergraphs for Sequential Recommendation — Li et al. (2021) (arXiv:2108.08134, 2021)
What this evaluates
Evaluates sequential recommendation models on predicting the next item a user will interact with, capturing temporal dynamics and handling sparse user-item interactions.
Datasets
- AMT — total 59495; splits: train (-1), val (-1), test (-1)
- Goodreads — total 1084781; splits: train (-1), val (-1), test (-1)
Metrics
HR@K (primary) — range: [0, 1]
- Hit Ratio at rank K: binary indicator (1 if ground truth item appears in top-K predicted list, 0 otherwise). Evaluated at K={1,5,10,20}.
NDCG@K (primary) — range: [0, 1]
- Normalized Discounted Cumulative Gain at rank K: sum of graded relevance (1 for hit) discounted by log2(rank+1), normalized by ideal DCG. Evaluated at K={1,5,10,20}.
Input / output format
Input: User's historical interaction sequence (ordered list of item IDs).
Output: Ranked list of candidate items (top-K predictions or full ranking over 101/501 items including sampled negatives).
Scoring recipe
def compute_metrics(predictions, ground_truth, k=10):
top_k = predictions[:k]
hr = 1.0 if ground_truth in top_k else 0.0
ndcg = 0.0
if ground_truth in top_k:
rank = top_k.index(ground_truth) + 1
ndcg = 1.0 / math.log2(rank + 1)
return hr, ndcg
Common pitfalls
- Negative sampling size (100 vs 500) drastically changes absolute metric values; results are not directly comparable across different sampling settings.
- Datasets use time-based chronological splits (last interactions in a specific year are validation/test), not random user/item splits.
- Evaluation is performed over a sampled candidate set (101 or 501 items) rather than the full item catalog due to computational constraints.
Evidence (verbatim from paper)
Our proposed method focuses on recommending next item, and therefore we use Top K Hit Ratio (HR@K) and Top K Normalized Discounted Cumulative Gain (NDCG@K) as our evaluation metrics. We choose K={1,5,10,20} in the baseline comparison experiment. ... in our experiment, we randomly choose {100,500} negative samples and rank {101,501} items to calculate the HR@K and NDCG@K scores.
Citation
@misc{li2021hyperbolic,
title={Hyperbolic Hypergraphs for Sequential Recommendation},
author={Li et al. (2021)},
year={2021},
note={arXiv:2108.08134}
}
1---2name: h2seqrec-eval3description: Evaluates sequential recommendation models on predicting the next item a user will interact with, capturing temporal dynamics and handling sparse user-item interactions. Use when the user wants to benchmark on AMT, Goodreads, or asks about evaluating this task. Reports HR@K, NDCG@K.4---56# h2seqrec-eval78> Hyperbolic Hypergraphs for Sequential Recommendation — Li et al. (2021) (arXiv:2108.08134, 2021)910## What this evaluates1112Evaluates sequential recommendation models on predicting the next item a user will interact with, capturing temporal dynamics and handling sparse user-item interactions.1314## Datasets1516- **AMT** — total 59495; splits: train (-1), val (-1), test (-1)17- **Goodreads** — total 1084781; splits: train (-1), val (-1), test (-1)1819## Metrics2021- `HR@K` **(primary)** — range: [0, 1]22 - Hit Ratio at rank K: binary indicator (1 if ground truth item appears in top-K predicted list, 0 otherwise). Evaluated at K={1,5,10,20}.23- `NDCG@K` **(primary)** — range: [0, 1]24 - Normalized Discounted Cumulative Gain at rank K: sum of graded relevance (1 for hit) discounted by log2(rank+1), normalized by ideal DCG. Evaluated at K={1,5,10,20}.2526## Input / output format2728**Input**: User's historical interaction sequence (ordered list of item IDs).2930**Output**: Ranked list of candidate items (top-K predictions or full ranking over 101/501 items including sampled negatives).3132## Scoring recipe3334```python35def compute_metrics(predictions, ground_truth, k=10):36 top_k = predictions[:k]37 hr = 1.0 if ground_truth in top_k else 0.038 ndcg = 0.039 if ground_truth in top_k:40 rank = top_k.index(ground_truth) + 141 ndcg = 1.0 / math.log2(rank + 1)42 return hr, ndcg43```4445## Common pitfalls4647- Negative sampling size (100 vs 500) drastically changes absolute metric values; results are not directly comparable across different sampling settings.48- Datasets use time-based chronological splits (last interactions in a specific year are validation/test), not random user/item splits.49- Evaluation is performed over a sampled candidate set (101 or 501 items) rather than the full item catalog due to computational constraints.5051## Evidence (verbatim from paper)5253> Our proposed method focuses on recommending next item, and therefore we use Top K Hit Ratio (HR@K) and Top K Normalized Discounted Cumulative Gain (NDCG@K) as our evaluation metrics. We choose K={1,5,10,20} in the baseline comparison experiment. ... in our experiment, we randomly choose {100,500} negative samples and rank {101,501} items to calculate the HR@K and NDCG@K scores.5455## Citation5657```bibtex58@misc{li2021hyperbolic,59 title={Hyperbolic Hypergraphs for Sequential Recommendation},60 author={Li et al. (2021)},61 year={2021},62 note={arXiv:2108.08134}63}64```6566- arXiv: 2108.08134