sampler_sample_weighted
Performs weighted random sampling from items with auto-normalized weights. Returns selected sample and normalized weight list, supporting multiple draws with or without replacement.
Instructions
[sampler] Weighted random selection. weights auto-normalized. Returns {sample, weights_normalized}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| weights | Yes | ||
| n | No | ||
| seed | No | ||
| replacement | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |