Random Bicycle Picker
Select bicycle record IDs from a caller-supplied normalized dataset while preserving dataset and source provenance.
Description
A bicycle picker can sample record identifiers from a dataset prepared by the caller.
A bicycle picker can sample record identifiers from a dataset prepared by the caller. Dataset identity, version and source metadata preserve the context needed to resolve selected IDs later.
The tool returns selectedIds (selected record ids); datasetId (dataset id); datasetVersion (dataset version); sourceId (source id). These are generated fixtures or selected identifiers; the result does not replace the caller’s choice of repertoire, dataset or intended use.
When to use Random Bicycle Picker
Use Random Bicycle Picker when you already have candidateIds, datasetId, datasetVersion, sourceId, selectionCount, withReplacement and want selectedIds, datasetId, datasetVersion, sourceId. Choose a curated candidate list and record its provenance; sampling selects identifiers without adding facts about those items.
How to use Random Bicycle Picker and understand its results
- Enter candidateIds, datasetId, datasetVersion, sourceId, selectionCount, withReplacement using the field table below. Match the units, ordering and data boundaries described in the calculation.
- Run the tool after checking the stated bounds and matching paired observations or categories. A malformed request gives a tool error rather than a usable measurement.
- Read selectedIds, datasetId, datasetVersion, sourceId. Use the calculation and interpretation below to distinguish amounts, ratios, signs and decision flags where applicable.
- Run again for another fixture. Preserve caller-supplied dataset metadata or separate exercise answers from prompts where present.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| candidateIds | Candidate record IDs | list of string | Required |
| datasetId | Dataset ID | string | Required |
| datasetVersion | Dataset version | string | Required |
| sourceId | Source ID | string | Required |
| selectionCount | Selection count | integer; minimum 1; maximum 1000 | Required |
| withReplacement | Sample with replacement | boolean; default false | Optional |
Supply 1–1000 distinct nonblank candidate IDs, nonblank datasetId/datasetVersion/sourceId and selectionCount 1–1000. With replacement, draw from the full list each time. Otherwise use a partial Fisher–Yates shuffle of a copy; count may not exceed candidate size. Return metadata unchanged.
with replacement: index = floor(draw×N); without replacement: index = position+floor(draw×remaining) The symbols refer to the supplied quantities or generated values described above; unit conversions and comparison boundaries follow the stated implementation.
{
"input": {
"candidateIds": [
"candidate-a",
"candidate-b",
"candidate-c"
],
"datasetId": "example/bicycle",
"datasetVersion": "1",
"selectionCount": 2,
"sourceId": "example",
"withReplacement": false
},
"randomDraw": 0.25,
"output": {
"datasetId": "example/bicycle",
"datasetVersion": "1",
"selectedIds": [
"candidate-a",
"candidate-b"
],
"sourceId": "example"
}
} Limitations and assumptions
Frame size, components, fit and availability are not inferred. There is no built-in bicycle catalogue, record download, weighted selection or recommendation. IDs and metadata are preserved rather than trimmed.
Random draws use context.random when injected and otherwise Math.random. No seed input or cryptographic randomness guarantee is provided. Consumed draws must be finite and in [0,1); repeated runs can repeat results.
Alternative or Complementary methods
Random Catalog Item Picker: Select references from caller-supplied normalized catalog records while preserving dataset and source provenance. Random Categorical Dataset Generator: Generate seeded categorical counts, then shuffle observations with a separately supplied random source.
Methodological background: Generator.choice: sampling with and without replacement.1
References
-
Generator.choice: sampling with and without replacement — NumPy developers
Similar or alternative tools
- Random Catalog Item Picker
Select references from caller-supplied normalized catalog records while preserving dataset and source provenance.
- Random Categorical Dataset Generator
Generate seeded categorical counts, then shuffle observations with a separately supplied random source.