Skip to main content
The UCI Bank Marketing dataset creates a retail banking decisioning environment for term deposit subscription campaigns. It is the only dataset pack with all 5 model types supported by KaireonAI: Scorecard, Bayesian, Gradient Boosted, Thompson Bandit, and Epsilon-Greedy. Based on the UCI ML Repository — Bank Marketing dataset (CC BY 4.0).
This dataset demonstrates tier progression from simple rule-based scoring (Scorecard) through probabilistic models (Bayesian) to ensemble methods (Gradient Boosted) and adaptive bandits (Thompson, Epsilon-Greedy).

What Gets Created

EntityCountDetails
Data Schemas + DDL Tables2bank_customers (1000 rows), bank_campaigns (1000 rows)
Categories1UCI Bank: Term Deposits
Channels3Cellular (sms/api), Telephone (phone/manual), Unknown (other/manual)
Offers1UCI Bank: Term Deposit Subscription (priority 90, $100k/month)
Creatives31 offer x 3 channels (SMS text, telephone script, generic)
Qualification Rules2Has Employment (excludes unknown/student), No Default (default_credit = “no”)
Algorithm Models5Scorecard, Bayesian, Gradient Boosted, Thompson Bandit, Epsilon-Greedy
Experiment1Three-Model Comparison: Scorecard 60% vs Bayesian 20% vs GB 20%
Decision Flow1Full pipeline with qualification, scoring, and targeting
Interaction History50090-day window of synthetic interactions

Step-by-Step Walkthrough

1
Load the UCI Bank Dataset
2
curl -X POST "http://localhost:3000/api/v1/seed-dataset/uci-bank?force=true" \
  -H "Content-Type: application/json" \
  -H "X-Requested-With: XMLHttpRequest"
3

Expected Response (201 Created)

{
  "success": true,
  "dataset": "uci-bank",
  "created": {
    "schemas": 2,
    "categories": 1,
    "subCategories": 1,
    "channels": 3,
    "offers": 1,
    "creatives": 3,
    "qualificationRules": 2,
    "contactPolicies": 0,
    "outcomeTypes": 5,
    "models": 5,
    "experiments": 1,
    "decisionFlows": 1,
    "segments": 0,
    "customerRows": 1000,
    "campaignRows": 1000,
    "interactionHistory": 500,
    "interactionSummaries": 500
  }
}
4
Explore the Qualification Rules
5
Two rules gate which customers are eligible for the term deposit offer:
6
curl "http://localhost:3000/api/v1/qualification-rules" \
  -H "X-Requested-With: XMLHttpRequest"
7
RuleConditionRationaleHas Employment (priority 100)bank_customers.job NOT IN ["unknown", "student"]Students and unknown job types unlikely to have funds for term depositsNo Default (priority 90)bank_customers.default_credit = "no"Customers with credit in default excluded per banking compliance
8
Recommend for a Qualified Customer
9
Qualified Customer
curl -X POST "http://localhost:3000/api/v1/recommend" \
  -H "Content-Type: application/json" \
  -H "X-Requested-With: XMLHttpRequest" \
  -d '{
  "customerId": "BANK-000042",
  "channel": "sms",
  "placement": "campaign",
  "limit": 1,
  "attributes": {
    "bank_customers.age": 45,
    "bank_customers.job": "management",
    "bank_customers.marital": "married",
    "bank_customers.education": "university.degree",
    "bank_customers.default_credit": "no",
    "bank_customers.housing_loan": "no",
    "bank_customers.personal_loan": "no",
    "bank_customers.balance": 12500.00
  }
}'
Student (Disqualified)
curl -X POST "http://localhost:3000/api/v1/recommend" \
  -H "Content-Type: application/json" \
  -H "X-Requested-With: XMLHttpRequest" \
  -d '{
  "customerId": "BANK-000099",
  "channel": "sms",
  "placement": "campaign",
  "limit": 1,
  "attributes": {
    "bank_customers.age": 22,
    "bank_customers.job": "student",
    "bank_customers.default_credit": "no",
    "bank_customers.balance": 500.00
  }
}'
Credit Default (Disqualified)
curl -X POST "http://localhost:3000/api/v1/recommend" \
  -H "Content-Type: application/json" \
  -H "X-Requested-With: XMLHttpRequest" \
  -d '{
  "customerId": "BANK-000200",
  "channel": "phone",
  "placement": "campaign",
  "limit": 1,
  "attributes": {
    "bank_customers.age": 38,
    "bank_customers.job": "blue-collar",
    "bank_customers.default_credit": "yes",
    "bank_customers.balance": 8000.00
  }
}'
10

Response — Qualified Customer (Offer Returned)

{
  "customerId": "BANK-000042",
  "decisions": [
    {
      "rank": 1,
      "offerId": "offer-uuid-...",
      "offerName": "UCI Bank: Term Deposit Subscription",
      "creativeId": "creative-uuid-cellular",
      "creativeName": "UCI Bank: Term Deposit — Cellular",
      "channelId": "chan-uuid-cellular",
      "channelName": "UCI Bank: Cellular",
      "score": 0.87,
      "modelUsed": "uci-bank-scorecard",
      "experimentArm": "champion",
      "content": {
        "body": "Hi! We have a great term deposit offer for you. Reply YES to learn more.",
        "cta": "Reply YES"
      },
      "interactionId": "ih-uuid-..."
    }
  ],
  "meta": {
    "candidatesEvaluated": 1,
    "qualificationsPassed": 2,
    "contactPoliciesApplied": 0,
    "modelType": "scorecard",
    "latencyMs": 12
  }
}
11
Record Outcomes
12
Record a Click
curl -X POST "http://localhost:3000/api/v1/respond" \
  -H "Content-Type: application/json" \
  -H "X-Requested-With: XMLHttpRequest" \
  -d '{
  "interactionId": "ih-uuid-from-recommend",
  "customerId": "BANK-000042",
  "outcomeType": "click",
  "context": {
    "source": "sms_link",
    "device": "mobile"
  }
}'
Record a Conversion
curl -X POST "http://localhost:3000/api/v1/respond" \
  -H "Content-Type: application/json" \
  -H "X-Requested-With: XMLHttpRequest" \
  -d '{
  "interactionId": "ih-uuid-from-recommend",
  "customerId": "BANK-000042",
  "outcomeType": "convert",
  "conversionValue": 250.00,
  "context": {
    "depositAmount": 10000,
    "termMonths": 12,
    "interestRate": 4.5
  }
}'
13
Train All 5 Models
14
Each model type has different training requirements:
15
Scorecard (Validate Rules)
curl -X POST "http://localhost:3000/api/v1/algorithm-models/<scorecard-id>/train" \
  -H "Content-Type: application/json" \
  -H "X-Requested-With: XMLHttpRequest" \
  -d '{}'
Bayesian
curl -X POST "http://localhost:3000/api/v1/algorithm-models/<bayesian-id>/train" \
  -H "Content-Type: application/json" \
  -H "X-Requested-With: XMLHttpRequest" \
  -d '{
  "trainingWindow": 90,
  "minSamples": 50
}'
Gradient Boosted
curl -X POST "http://localhost:3000/api/v1/algorithm-models/<gb-id>/train" \
  -H "Content-Type: application/json" \
  -H "X-Requested-With: XMLHttpRequest" \
  -d '{
  "trainingWindow": 90,
  "minSamples": 100,
  "validationSplit": 0.2
}'
16
Check the Three-Model Experiment
17
curl "http://localhost:3000/api/v1/experiments" \
  -H "X-Requested-With: XMLHttpRequest"

All 5 Model Types

Model 1: Scorecard

The simplest model — a rule-based scoring system. No training data required.
PropertyValue
Keyuci-bank-scorecard
Base Score50
Score Range0 — 100
Normalizationmin_max
Scoring Rules:
RuleFieldConditionPoints
r1age>= 30+10
r2balance>= 5,000+20
r3default_credit= “no”+15
r4housing_loan= “no”+10
Customer: BANK-000042 (age=45, balance=12500, default_credit="no", housing_loan="no")

  Base score:        50
  + age >= 30:       +10
  + balance >= 5000: +20
  + no default:      +15
  + no housing loan: +10
  Raw score:         105 → capped at 100
  Normalized:        1.00

Model 2: Bayesian (Naive Bayes)

Probabilistic model using Bayes’ theorem with 7 predictors.
PropertyValue
Keyuci-bank-bayesian
Laplace Smoothingalpha = 1
Prior Positive Rate0.12 (12% base subscription rate)
Predictorsbalance, age, job, education, housing_loan, marital, personal_loan

Model 3: Gradient Boosted

Ensemble method with the highest accuracy. 8 predictors and 150 estimators.
PropertyValue
Keyuci-bank-gradient-boosted
Learning Rate0.05
Max Depth6
N Estimators150
Subsample Rate0.80

Model 4: Thompson Bandit

Multi-armed bandit using Thompson Sampling with Beta-Bernoulli conjugate priors.
PropertyValue
Keyuci-bank-thompson
Arms2 (subscribe / not-subscribe)
Initial Alpha/Beta1, 1 (uniform prior)
PredictorsNone (context-free bandit)
The Thompson Bandit has no predictors — it does not use customer features. It learns a global subscription probability. For personalized scoring, use the supervised models.

Model 5: Epsilon-Greedy

Simpler bandit that exploits the best arm most of the time but explores randomly with probability epsilon.
PropertyValue
Keyuci-bank-epsilon
Epsilon0.10 (10% exploration)
Decay0.995 per iteration
Min Epsilon0.01 (1% floor)

Model Comparison

Model TypePredictorsTraining RequiredPersonalizedBest For
scorecard4No (rule-based)YesQuick start, business rules
bayesian7YesYesSmall data, probabilistic estimates
gradient_boosted8YesYesLarge data, highest accuracy
thompson_bandit0Online (auto)NoOffer/creative testing
epsilon_greedy0Online (auto)NoSimple A/B testing, fast convergence

Three-Model Experiment

The experiment runs a champion/challenger test with 60/20/20 traffic split:
ArmModelTraffic %
ChampionScorecard60%
Challenger 1Bayesian20%
Challenger 2Gradient Boosted20%
The experiment uses deterministic hashing of the customer ID. Customer BANK-000042 always goes to the same arm, ensuring consistent experience and clean measurement. The bandits (Thompson, Epsilon-Greedy) are not in the experiment — they are standalone adaptive models.

What to Look For

  • Tier progression: Start with Scorecard (no data needed), add Bayesian (50+ interactions), then Gradient Boosted (100+ interactions), then bandits for continuous optimization.
  • Qualification gating: Students and customers with credit defaults are blocked. Try different job and default_credit values.
  • Scoring breakdown: The Scorecard model produces transparent scores. A customer with age=45, balance=12500 scores 1.00 (max). A customer with age=22, balance=800 scores 0.50 (base only).
  • No contact policies: The UCI Bank pack has zero contact policies, enabling unconstrained outreach. Add your own to test frequency capping.
  • Three-channel creatives: SMS text for cellular, agent scripts for telephone, generic for unknown — each channel has appropriate content.