Description
Compose synthetic baskets from supplied co-purchase templates and independent background draws, retaining planted labels and delegated mining evidence with unrounded count metrics.
Synthetic statistical data separates a specified generating model from the values observed in a finite draw. A model parameter, a sample summary, and the result of a fitted analysis answer different questions; retaining them separately makes numerical and statistical checks easier to interpret.
Compose synthetic baskets from supplied co-purchase templates and independent background draws, retaining planted labels and delegated mining evidence with unrounded count metrics.
When to use this tool
Use this generator to create reproducible market basket transaction dataset cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply items, templates, transactionCount, templateProbability, backgroundProbability, minimumSupport, minimumConfidence, maximumSize in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read transactions, mining. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.
For each transaction, optionally plant a supplied item template, independently add background items, and ensure the basket is nonempty. Sort distinct items and delegate frequent-itemset and association-rule evidence under the supplied support and confidence thresholds.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| items | Items | Required. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 6. |
| templates | Templates | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 8. |
| templates[].label | Caller-facing text label; not a globally unique identifier. | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 64. |
| templates[].items | Items | Required. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 6. |
| transactionCount | Transaction Count | Required. Safe integer; minimum 1; maximum 128. |
| templateProbability | Template Probability | Required. Finite number; minimum 0; maximum 1. |
| backgroundProbability | Background Probability | Required. Finite number; minimum 0; maximum 1. |
| minimumSupport | Minimum Support | Required. Finite number; maximum 1; strictly above 0. |
| minimumConfidence | Minimum Confidence | Required. Finite number; minimum 0; maximum 1. |
| maximumSize | Maximum Size | Required. Safe integer; minimum 2; maximum 3. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| transactions | Transactions | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 128. |
| transactions[].items | Items | Required. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 6. |
| transactions[].plantedTemplate | Planted Template | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 64. or Null. |
| mining | Mining | Required. Object; no unknown keys. |
| mining.itemsets | Itemsets | Required. Array of Object; no unknown keys.; minimum items 0; maximum items 41. |
| mining.itemsets[].items | Items | Required. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 3. |
| mining.itemsets[].count | Requested count; the mechanics explain whether one draw expands into several returned records. | Required. Safe integer; minimum 0; maximum 128. |
| mining.itemsets[].support | Support | Required. Finite number. |
| mining.itemsets[].coreSupport | Core Support | Required. Finite number. |
| mining.rules | Rules | Required. Array of Object; no unknown keys.; minimum items 0; maximum items 150. |
| mining.rules[].antecedent | Antecedent | Required. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 3. |
| mining.rules[].consequent | Consequent | Required. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 3. |
| mining.rules[].support | Support | Required. Finite number. |
| mining.rules[].confidence | Confidence | Required. Finite number. |
| mining.rules[].lift | Lift | Required. Finite number. |
| mining.rules[].coreSupport | Core Support | Required. Finite number. |
| mining.rules[].coreConfidence | Core Confidence | Required. Finite number. |
| mining.rules[].coreLift | Core Lift | Required. Finite number. |
| randomness | Replay metadata: source is seed or context; seed is the normalized 32-bit seed or null for a context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional numeric replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"items": [
"bread",
"milk"
],
"templates": [
{
"label": "breakfast",
"items": [
"bread",
"milk"
]
}
],
"transactionCount": 4,
"templateProbability": 0.5,
"backgroundProbability": 0.25,
"minimumSupport": 0.25,
"minimumConfidence": 0.5,
"maximumSize": 2,
"seed": 42
},
"output": {
"transactions": [
{
"items": [
"milk"
],
"plantedTemplate": null
},
{
"items": [
"bread",
"milk"
],
"plantedTemplate": "breakfast"
},
{
"items": [
"milk"
],
"plantedTemplate": null
},
{
"items": [
"bread"
],
"plantedTemplate": null
}
],
"mining": {
"itemsets": [
{
"items": [
"bread"
],
"count": 2,
"support": 0.5,
"coreSupport": 0.5
},
{
"items": [
"milk"
],
"count": 3,
"support": 0.75,
"coreSupport": 0.75
},
{
"items": [
"bread",
"milk"
],
"count": 1,
"support": 0.25,
"coreSupport": 0.25
}
],
"rules": [
{
"antecedent": [
"bread"
],
"consequent": [
"milk"
],
"support": 0.25,
"confidence": 0.5,
"lift": 0.6666666666666666,
"coreSupport": 0.25,
"coreConfidence": 0.5,
"coreLift": 0.666666666667
}
]
},
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- A planted template label records construction, not a mined result. Sampling noise and background items can create other associations; this is synthetic transaction evidence rather than consumer behavior or causal inference.
- A replay requires the same complete input and implementation. Randomized construction does not guarantee uniform coverage of every feasible output; finite samples can repeat unless a distinct-selection rule is explicitly stated.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Random Heavy-Tail Comparison Experiment Generator
Compare matched-size Cauchy and Pareto Type I samples with visible derived sampler seeds, observed extremes, medians, and linearly interpolated empirical quantiles; preserve Pareto sampler 10-significant-digit rounding and epsilon tail clipping, and do not report a finite Cauchy population mean or variance.
- Random Transaction Itemset Instance Generator
Generate exact-count set-valued transactions by choosing a uniform size and a without-replacement subset from distinct supplied item labels; transactions may repeat and imported frequencies count transaction presence.