Evaluates a model's ability to perform session-based next-item recommendation by capturing both spatial graph structures and temporal dynamics. It probes how well the model aggregates collaborative filtering signals and session-specific sequences to predict the subsequent item in a user's browsing session. Use when the user wants to benchmark on Tmall, Diginetica, Gowalla, RetailRocket, Nowplaying, LastFM, or asks about evaluating this task. Reports cross-entropy.
Installs into .claude/skills of the current project.
Are you the author of Restc Sbr Eval?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/qhjqhj00-restc-sbr-eval)
---
name: restc-sbr-eval
description: Evaluates a model's ability to perform session-based next-item recommendation by capturing both spatial graph structures and temporal dynamics. It probes how well the model aggregates collaborative filtering signals and session-specific sequences to predict the subsequent item in a user's browsing session. Use when the user wants to benchmark on Tmall, Diginetica, Gowalla, RetailRocket, Nowplaying, LastFM, or asks about evaluating this task. Reports cross-entropy.
metadata:
skill_kind: dataset_eval
source_arxiv: 2209.11461
bibtex_key: wan2022restc
confidence: high
---
# restc-sbr-eval
> Spatio-Temporal Contrastive Learning Enhanced GNNs for Session-based Recommendation — Wan et al. (2022) (arXiv:2209.11461, 2022)
## What this evaluates
Evaluates a model's ability to perform session-based next-item recommendation by capturing both spatial graph structures and temporal dynamics. It probes how well the model aggregates collaborative filtering signals and session-specific sequences to predict the subsequent item in a user's browsing session.
## Datasets
- **Tmall** — total 377166; splits: train (351268), test (25898)
- **Diginetica** — total 780328; splits: train (719470), test (60858)
- **Gowalla** — total 574532; splits: train (419200), test (155332)
- **RetailRocket** — total 448780; splits: train (433648), test (15132)
- **Nowplaying** — total 915128; splits: train (825304), test (89824)
- **LastFM** — total 3510163; splits: train (2837330), test (672833)
## Metrics
- `cross-entropy` **(primary)** — range: [0, 1]
- Cross-entropy loss between the predicted probability distribution over candidate items and the ground truth next item: $\mathcal{L}_{main} = -\sum_{i=1}^{N} y_i \log(\hat{y}_i) + (1-y_i)\log(1-\hat{y}_i)$.
## Input / output format
**Input**: A session sequence consisting of ordered item IDs and their corresponding timestamps.
**Output**: A probability distribution vector of size N (number of items) representing the likelihood of each candidate item being the next click.
## Scoring recipe
```python
def compute_loss(predictions, targets):
loss = -torch.sum(targets * torch.log(predictions + 1e-9)) / targets.shape[0]
return loss
```
## Common pitfalls
- Data leakage when constructing the global Collaborative Filtering Graph (CFG) if future session interactions are inadvertently included in the training graph.
- Handling of directed cycles and high in-degree items, which can distort message passing in the graph encoder if not properly regularized.
- Session sparsity: short sessions (avg length ~3-7) may lack sufficient temporal signals, making spatial graph aggregation critical but prone to noise.
## Evidence (verbatim from paper)
> Then, we apply cross-entropy as our objective function of the main task with the ground truth ${\mathbf{y}_{1},\mathbf{y}_{2},\mathbf{y}_{3},\ldots,\mathbf{y}_{N}}:
## Citation
```bibtex
@misc{wan2022restc,
title={Spatio-Temporal Contrastive Learning Enhanced GNNs for Session-based Recommendation},
author={Wan et al. (2022)},
year={2022},
note={arXiv:2209.11461}
}
```
- arXiv: 2209.11461