{
  "name": "Generate transactions with rare fraud labels",
  "description": "Create 10,000 synthetic US card transactions with transaction ID, timestamp, amount, merchant, category, channel, city and state. Use a long-tailed amount from $1 to $4,000. Make about 45% online. Set fraud probability to 2% for card-present transactions and 4% online, and make merchant categories depend on channel.",
  "rowCount": 10000,
  "seed": 31337,
  "columns": [
    {
      "id": "col_txn",
      "name": "transaction_id",
      "kind": "uuid",
      "nullRate": 0
    },
    {
      "id": "col_ts",
      "name": "timestamp",
      "kind": "date",
      "start": "2025-01-01",
      "end": "2025-06-30",
      "format": "datetime",
      "nullRate": 0
    },
    {
      "id": "col_amount",
      "name": "amount_usd",
      "kind": "number",
      "min": 1,
      "max": 4000,
      "decimals": 2,
      "distribution": "lognormal",
      "nullRate": 0
    },
    {
      "id": "col_merchant",
      "name": "merchant",
      "kind": "faker",
      "generator": "company.name",
      "nullRate": 0
    },
    {
      "id": "col_mcc",
      "name": "merchant_category",
      "kind": "category",
      "options": [
        {
          "value": "grocery",
          "weight": 25
        },
        {
          "value": "restaurants",
          "weight": 20
        },
        {
          "value": "gas",
          "weight": 12
        },
        {
          "value": "travel",
          "weight": 8
        },
        {
          "value": "electronics",
          "weight": 7
        },
        {
          "value": "online_retail",
          "weight": 20
        },
        {
          "value": "other",
          "weight": 8
        }
      ],
      "nullRate": 0
    },
    {
      "id": "col_issuer",
      "name": "card_issuer",
      "kind": "faker",
      "generator": "finance.creditCardIssuer",
      "nullRate": 0
    },
    {
      "id": "col_last4",
      "name": "card_last4",
      "kind": "faker",
      "generator": "finance.last4",
      "nullRate": 0
    },
    {
      "id": "col_channel",
      "name": "channel",
      "kind": "category",
      "options": [
        {
          "value": "card_present",
          "weight": 55
        },
        {
          "value": "online",
          "weight": 45
        }
      ],
      "nullRate": 0
    },
    {
      "id": "col_city",
      "name": "city",
      "kind": "faker",
      "generator": "location.city",
      "nullRate": 0
    },
    {
      "id": "col_state",
      "name": "state",
      "kind": "faker",
      "generator": "location.stateCode",
      "nullRate": 0
    },
    {
      "id": "col_fraud",
      "name": "is_fraud",
      "kind": "boolean",
      "trueProbability": 0.02,
      "nullRate": 0
    }
  ],
  "relationships": [
    {
      "kind": "probabilityWhen",
      "column": "is_fraud",
      "when": {
        "type": "values",
        "column": "channel",
        "values": [
          "online"
        ]
      },
      "trueProbability": 0.04
    },
    {
      "kind": "categoryWhen",
      "column": "merchant_category",
      "when": {
        "type": "values",
        "column": "channel",
        "values": [
          "online"
        ]
      },
      "options": [
        {
          "value": "grocery",
          "weight": 8
        },
        {
          "value": "restaurants",
          "weight": 6
        },
        {
          "value": "gas",
          "weight": 1
        },
        {
          "value": "travel",
          "weight": 15
        },
        {
          "value": "electronics",
          "weight": 15
        },
        {
          "value": "online_retail",
          "weight": 50
        },
        {
          "value": "other",
          "weight": 5
        }
      ]
    }
  ]
}
