Skip to content

Main content

Random Market Basket Transaction Dataset Generator

Compose synthetic baskets from supplied co-purchase templates and independent background draws, retaining planted labels and delegated mining evidence with unrounded count metrics.

Loading tool…

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

  1. Supply items, templates, transactionCount, templateProbability, backgroundProbability, minimumSupport, minimumConfidence, maximumSize in the field shapes below. Set seed when you need an explicit replay.
  2. 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.
  3. 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 fieldMeaning and unitsAccepted input
itemsItemsRequired. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 6.
templatesTemplatesRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 8.
templates[].labelCaller-facing text label; not a globally unique identifier.Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 64.
templates[].itemsItemsRequired. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 6.
transactionCountTransaction CountRequired. Safe integer; minimum 1; maximum 128.
templateProbabilityTemplate ProbabilityRequired. Finite number; minimum 0; maximum 1.
backgroundProbabilityBackground ProbabilityRequired. Finite number; minimum 0; maximum 1.
minimumSupportMinimum SupportRequired. Finite number; maximum 1; strictly above 0.
minimumConfidenceMinimum ConfidenceRequired. Finite number; minimum 0; maximum 1.
maximumSizeMaximum SizeRequired. Safe integer; minimum 2; maximum 3.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
transactionsTransactionsRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 128.
transactions[].itemsItemsRequired. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 6.
transactions[].plantedTemplatePlanted TemplateRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 64. or Null.
miningMiningRequired. Object; no unknown keys.
mining.itemsetsItemsetsRequired. Array of Object; no unknown keys.; minimum items 0; maximum items 41.
mining.itemsets[].itemsItemsRequired. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 3.
mining.itemsets[].countRequested count; the mechanics explain whether one draw expands into several returned records.Required. Safe integer; minimum 0; maximum 128.
mining.itemsets[].supportSupportRequired. Finite number.
mining.itemsets[].coreSupportCore SupportRequired. Finite number.
mining.rulesRulesRequired. Array of Object; no unknown keys.; minimum items 0; maximum items 150.
mining.rules[].antecedentAntecedentRequired. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 3.
mining.rules[].consequentConsequentRequired. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 64.; minimum items 1; maximum items 3.
mining.rules[].supportSupportRequired. Finite number.
mining.rules[].confidenceConfidenceRequired. Finite number.
mining.rules[].liftLiftRequired. Finite number.
mining.rules[].coreSupportCore SupportRequired. Finite number.
mining.rules[].coreConfidenceCore ConfidenceRequired. Finite number.
mining.rules[].coreLiftCore LiftRequired. Finite number.
randomnessReplay 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.seedOptional numeric replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. 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.

json
{
  "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

  1. Tool behavior and example: Random Market Basket Transaction Dataset Generator — tool.io

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.