File size: 1,618 Bytes
fefeaf6
5c69c70
 
 
 
 
 
2d66a97
5c69c70
 
 
fefeaf6
5c69c70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
tags:
- permutation
- algorithmic-reasoning
- synthetic
- sequence-classification
task_categories:
- other
pretty_name: Permutation Same-Cycle Matrices
size_categories:
- 10K<n<100K
---

# Permutation same-cycle matrices

Synthetic data for predicting whether two individuals belong to the same cycle of a permutation. Each example contains a zero-based permutation and its binary cycle-equivalence matrix. Entry `(i, j)` is `1` exactly when individuals `i` and `j` are in the same cycle.

## Contents

The dataset includes permutation sizes `p = 7, 8, 9, 10`. For each size there are 4,096 training examples and 100 test examples. Within each size, train and test permutations are sampled uniformly without replacement and are disjoint. The sampling seed is `0`.

Files are split by permutation size so the matrix shape is explicit: `data/p7-train-00000-of-00001.parquet`, through `p10-test-00000-of-00001.parquet`.

## Features

- `permutation`: zero-based permutation tokens, length `p`
- `same_cycle`: binary `p x p` matrix
- `permutation_size`: `p`
- `source_rank`: lexicographic rank of the sampled permutation

## Load

```python
from datasets import load_dataset

train_files = [
    "data/p7-train-00000-of-00001.parquet",
    "data/p8-train-00000-of-00001.parquet",
    "data/p9-train-00000-of-00001.parquet",
    "data/p10-train-00000-of-00001.parquet",
]
test_files = [f.replace("-train-", "-test-") for f in train_files]
ds = load_dataset("parquet", data_files={"train": train_files, "test": test_files})
```

The data-generation logic is based on `predict_integers_in_same_cycle/data_generation.py`.