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
| Entity | Count | Details |
|---|
| Data Schemas + DDL Tables | 2 | bank_customers (1000 rows), bank_campaigns (1000 rows) |
| Categories | 1 | UCI Bank: Term Deposits |
| Channels | 3 | Cellular (sms/api), Telephone (phone/manual), Unknown (other/manual) |
| Offers | 1 | UCI Bank: Term Deposit Subscription (priority 90, $100k/month) |
| Creatives | 3 | 1 offer x 3 channels (SMS text, telephone script, generic) |
| Qualification Rules | 2 | Has Employment (excludes unknown/student), No Default (default_credit = “no”) |
| Algorithm Models | 5 | Scorecard, Bayesian, Gradient Boosted, Thompson Bandit, Epsilon-Greedy |
| Experiment | 1 | Three-Model Comparison: Scorecard 60% vs Bayesian 20% vs GB 20% |
| Decision Flow | 1 | Full pipeline with qualification, scoring, and targeting |
| Interaction History | 500 | 90-day window of synthetic interactions |
Step-by-Step Walkthrough
Load the UCI Bank Dataset
curl -X POST "http://localhost:3000/api/v1/seed-dataset/uci-bank?force=true" \
-H "Content-Type: application/json" \
-H "X-Requested-With: XMLHttpRequest"
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
}
}
Explore the Qualification Rules
Two rules gate which customers are eligible for the term deposit offer:
curl "http://localhost:3000/api/v1/qualification-rules" \
-H "X-Requested-With: XMLHttpRequest"
| Rule | Condition | Rationale |
|---|
| Has Employment (priority 100) | bank_customers.job NOT IN ["unknown", "student"] | Students and unknown job types unlikely to have funds for term deposits |
| No Default (priority 90) | bank_customers.default_credit = "no" | Customers with credit in default excluded per banking compliance |
Recommend for a 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
}
}'
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
}
}'
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
}
}
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"
}
}'
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
}
}'
Each model type has different training requirements:
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 '{}'
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
}'
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
}'
Check the Three-Model Experiment
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.
| Property | Value |
|---|
| Key | uci-bank-scorecard |
| Base Score | 50 |
| Score Range | 0 — 100 |
| Normalization | min_max |
Scoring Rules:
| Rule | Field | Condition | Points |
|---|
| r1 | age | >= 30 | +10 |
| r2 | balance | >= 5,000 | +20 |
| r3 | default_credit | = “no” | +15 |
| r4 | housing_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.
| Property | Value |
|---|
| Key | uci-bank-bayesian |
| Laplace Smoothing | alpha = 1 |
| Prior Positive Rate | 0.12 (12% base subscription rate) |
| Predictors | balance, age, job, education, housing_loan, marital, personal_loan |
Model 3: Gradient Boosted
Ensemble method with the highest accuracy. 8 predictors and 150 estimators.
| Property | Value |
|---|
| Key | uci-bank-gradient-boosted |
| Learning Rate | 0.05 |
| Max Depth | 6 |
| N Estimators | 150 |
| Subsample Rate | 0.80 |
Model 4: Thompson Bandit
Multi-armed bandit using Thompson Sampling with Beta-Bernoulli conjugate priors.
| Property | Value |
|---|
| Key | uci-bank-thompson |
| Arms | 2 (subscribe / not-subscribe) |
| Initial Alpha/Beta | 1, 1 (uniform prior) |
| Predictors | None (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.
| Property | Value |
|---|
| Key | uci-bank-epsilon |
| Epsilon | 0.10 (10% exploration) |
| Decay | 0.995 per iteration |
| Min Epsilon | 0.01 (1% floor) |
Model Comparison
| Model Type | Predictors | Training Required | Personalized | Best For |
|---|
| scorecard | 4 | No (rule-based) | Yes | Quick start, business rules |
| bayesian | 7 | Yes | Yes | Small data, probabilistic estimates |
| gradient_boosted | 8 | Yes | Yes | Large data, highest accuracy |
| thompson_bandit | 0 | Online (auto) | No | Offer/creative testing |
| epsilon_greedy | 0 | Online (auto) | No | Simple A/B testing, fast convergence |
Three-Model Experiment
The experiment runs a champion/challenger test with 60/20/20 traffic split:
| Arm | Model | Traffic % |
|---|
| Champion | Scorecard | 60% |
| Challenger 1 | Bayesian | 20% |
| Challenger 2 | Gradient Boosted | 20% |
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.