Docs

Docs

TSRBench data schema, method asset interface, and metric interface.

Data format

Datasets should include metadata, query/candidate sequences and retrieval pools.

UCR-R directory

UCR_root/
  group_a/
    subset_x/
      class1.tsv
      class2.tsv
  group_b/
    subset_y/
      class12.tsv

UCR-R TSV schema

# parser uses: pd.read_csv(tsv, sep="\t", header=None)
# class_id = first number parsed from file name
# each row uses row[1:] as the time-series values

id\t0.13\t0.17\t0.09\t...
id\t0.21\t0.24\t0.18\t...

CU-RCA directory

anomly/
  case_001/
    sensors.tsv
  case_002/
    sensors.tsv

CU-RCA TSV schema

# parser uses: pd.read_csv(tsv, sep="\t")
# row[0]=sensor_name, row[1]=label (0/1), row[2:]=series

sensor\tlabel\tt0\tt1\tt2\t...
S1\t0\t0.13\t0.17\t0.09\t...
S2\t1\t0.22\t0.24\t0.30\t...

Method interface

The primary supported method asset is a precomputed distance library aligned to dataset IDs.

Upload checklist

Method asset upload checklist
1) Upload one or more .pkl files keyed by method name.
2) Ensure query/candidate alignment matches the selected dataset split.
3) Distances must keep the same ordering as the labels they are evaluated against.
4) Lower distance means higher similarity for ranking.

UCR-R precomputed distance library (.pkl)

{
  "DTW": [
    {
      "query_key": [12, 5],
      "labels": [1, 0, 0, 1, ...],
      "candidate_keys": [[12, 9], [7, 1], ...],
      "candidate_classes": [12, 7, ...],
      "distances": [0.312, 2.441, ...],
      "valid_count": 128
    }
  ]
}

CU-RCA precomputed distance library (.pkl)

{
  "DTW": [
    {
      "file": "case_001/sensors.tsv",
      "entries": [
        {
          "baseline_index": 0,
          "distances": [0.31, 0.72, ...],
          "labels": [0, 1, ...],
          "names": ["S2", "S3", ...]
        }
      ],
      "has_anomaly": 1,
      "baseline_indices": [0, 4, 6]
    }
  ]
}

Field semantics and alignment rules

UCR-R distance record fields
- query_key: [class_id, sample_index] for one query
- labels: relevance labels aligned with candidate_keys/distances
- candidate_keys: [class_id, sample_index] per candidate
- candidate_classes: class id per candidate
- distances: numeric distance list (same length/order as labels)
- valid_count: number of finite distances in this query

CU-RCA distance record fields
- file: source case path under anomaly root
- entries[].baseline_index: baseline sensor index used as anchor
- entries[].distances / labels / names: aligned candidate triplet
- has_anomaly: whether this case contains anomaly labels
- baseline_indices: anchors used in this file

Metric interface

Built-in metrics and AdaBase metrics follow a normalized output schema for leaderboard and chart rendering.

Normalized outputs vs runnable metric assets

Metric interfaces
- Normalized metric outputs: JSON/CSV values rendered by leaderboard, scatter, and scorecard.
- Runnable metric assets: executable metric code that consumes distance libraries and emits normalized outputs.

Current rendering schema expects stable metric ids such as:
avg_hit@k, map@k, avg_precision@k, avg_recall@k, avg_ndcg@k,
MAP, avg_adaptive_ndcg, NDCG@10, MAP@10, AB-NDCG_*, AB-MAP_*.

For CU-RCA result rendering, metrics are restricted to:
hit@1, hit@3, hit@5 (mapped to RCA-Hit@1/3/5 in UI).

Metric output schema (UCR-R)

{
  "avg_hit@1": 0.0000,
  "avg_hit@3": 0.0000,
  "avg_hit@5": 0.0000,
  "map@1": 0.0000,
  "map@3": 0.0000,
  "map@5": 0.0000,
  "map@10": 0.0000,
  "avg_precision@1": 0.0000,
  "avg_recall@1": 0.0000,
  "avg_ndcg@1": 0.0000,
  "avg_precision@3": 0.0000,
  "avg_recall@3": 0.0000,
  "avg_ndcg@3": 0.0000,
  "avg_precision@5": 0.0000,
  "avg_recall@5": 0.0000,
  "avg_ndcg@5": 0.0000,
  "avg_precision@10": 0.0000,
  "avg_recall@10": 0.0000,
  "avg_ndcg@10": 0.0000,
  "MAP": 0.0000,
  "avg_adaptive_ndcg": 0.0000,
  "NDCG@10": 0.0000,
  "MAP@10": 0.0000,
  "AB-NDCG_log": 0.0000,
  "AB-NDCG_lin": 0.0000,
  "AB-NDCG_exp": 0.0000,
  "AB-MAP_log": 0.0000,
  "AB-MAP_lin": 0.0000,
  "AB-MAP_exp": 0.0000
}

Summary schema (CU-RCA)

{
  "method_a": { "hit@1": 0.0000, "hit@3": 0.0000, "hit@5": 0.0000 },
  "method_b": { "hit@1": 0.0000, "hit@3": 0.0000, "hit@5": 0.0000 }
}