sampler_sample_stratified
Given a groups dictionary and number per group, randomly sample that many items from each group to create a balanced stratified sample. Optional seed ensures reproducibility. Returns sample with group-to-item-list mapping.
Instructions
[sampler] Balanced sampling: n_per_group items from each group dict key. Returns {sample: {group: [items]}}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groups | Yes | ||
| n_per_group | Yes | ||
| seed | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |