Sub topic 13
Beyond scorecards: statistical and machine learning models
This chapter assumes you have read the earlier chapters on factor scoring, weighting, override rules, rating bands and model validation. You should also be comfortable reading Python with NumPy and scikit-learn. It covers what changes when the weights in a scorecard are learned from data instead of set by judgment, and where that approach fails in AML.
What a scorecard leaves on the table
The weighted scorecard from earlier chapters has three properties:
- The weights (30/30/25/15) come from expert judgment.
- Each factor contributes independently, and the contributions add up.
- Anyone can explain the result by reading the table.
Judgment-based weights have a weakness. Nobody can show that geography deserves 30% rather than 20%. Additive scoring also cannot express interactions, such as a cash-intensive business that is also new and uses a high-risk corridor. Statistical and machine learning (ML) models address both problems by estimating weights and interactions from historical outcomes. In exchange, they add data requirements, validation work and explainability work.
Three families of approaches
| Approach | What it learns | Typical algorithm | Main strength | Main weakness |
|---|---|---|---|---|
| Statistical scorecard | One weight per factor from labeled outcomes | Logistic regression | Stays additive and explainable | Misses interactions |
| Supervised ML | Non-linear patterns and interactions | Gradient-boosted trees, random forest | Higher ranking power | Harder to explain and validate |
| Unsupervised ML | What "unusual" looks like, with no labels | Isolation forest, clustering | Finds patterns nobody has labeled | Output is "different", not "risky" |
Most institutions adopt these in order. They start with logistic regression, which regulators and validators already know. They use gradient boosting as a challenger model. They use unsupervised methods to find segments or anomalies for human review, not to assign ratings directly.
The label problem
Supervised learning needs a target: a column saying which customers turned out to be risky. AML has no clean target, because confirmed money laundering is rarely observed. Teams use proxies, and each proxy has a bias:
- Suspicious activity reports (SARs) filed. A SAR records an analyst's suspicion, not a conviction. The model learns what your existing monitoring and analysts already flag.
- Account exits for financial-crime reasons. This is a smaller sample and depends on policy.
- Law-enforcement requests or confirmed cases. This is the cleanest label, but it is very rare and arrives late.
This creates a feedback loop. Customers rated High get more scrutiny, so they generate more SARs. A model trained on SARs then learns that High-rated customers are risky, and it confirms the ratings it was trained on. Customers rated Low are watched less, so their laundering goes undetected and they look safe. Mitigations include training on a sample with uniform scrutiny, using several labels, and treating model outputs as relative ranking, not truth.
Class imbalance is a second problem. If 1% of customers have a positive label, a model that predicts "no" for everyone is 99% accurate and useless. Judge models by ranking metrics such as area under the ROC curve (AUC) and precision at a fixed review capacity, not by accuracy.
Learning weights with logistic regression
Logistic regression models the log-odds of the label as a weighted sum of inputs. That has the same shape as the scorecard, with the weights estimated from data. The example below uses synthetic data, so it shows the mechanics only. It does not show realistic AML performance.
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import train_test_split
NAMES = ["customer", "geography", "product", "channel"]
rng = np.random.default_rng(42)
n = 5000
X = rng.integers(1, 6, size=(n, 4)) # factor scores 1-5, same scale as the scorecard
# Synthetic "truth": geography and customer matter most, channel barely at all.
logit = -8.0 + 0.9 * X[:, 0] + 0.5 * X[:, 1] + 0.3 * X[:, 2] + 0.1 * X[:, 3]
y = (rng.random(n) < 1 / (1 + np.exp(-logit))).astype(int)
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.3, random_state=0, stratify=y
)
model = LogisticRegression(max_iter=1000)
model.fit(X_train, y_train)
auc = roc_auc_score(y_test, model.predict_proba(X_test)[:, 1])
print("positive rate:", round(y.mean(), 3))
print("test AUC:", round(auc, 3))
coefs = model.coef_[0]
for name, c in zip(NAMES, coefs):
print(f"{name:10s} coefficient {c:6.2f} relative weight {c / coefs.sum():.2f}")The relative weights are directly comparable to the hand-set 0.30/0.30/0.25/0.15. Dividing by the sum only makes sense when all coefficients are positive. A negative coefficient on a risk factor is a warning sign. It often means correlated inputs or a label artifact, and you should investigate it before using the model.
The weights also come with uncertainty. With few positive labels, coefficient estimates swing between samples. Report confidence intervals or re-fit on bootstrap samples before telling the business that "channel is worth 15%".
Keeping overrides around the model
A learned model does not replace the override rules. A PEP or a sanctions match is a policy or legal requirement. The model might never assign it a high score, because the training data had few such cases. Run the model inside the same wrapper as the scorecard:
def assign_rating_model(model, factors, is_pep=False, sanctions_match=False):
"""factors is a list of four scores ordered as NAMES."""
if sanctions_match:
return "Escalate"
p = model.predict_proba([factors])[0, 1]
rating = "Low" if p < 0.02 else "Medium" if p < 0.10 else "High" # illustrative cutoffs
if is_pep:
rating = "High"
return rating
print(assign_rating_model(model, [2, 4, 3, 2]))
print(assign_rating_model(model, [2, 4, 3, 2], is_pep=True))The probability cutoffs are a business decision. Set them from review capacity and risk appetite, as in the banding chapter. Do not use 0.5. The model's output is a probability of the proxy label, not of money laundering.
Non-linear and unsupervised models
Gradient-boosted trees can capture interactions without you specifying them. They often rank better than logistic regression, particularly when you add behavioral inputs such as transaction velocity or counterparty diversity. Three practical costs follow.
- Explainability. A rating must be explainable to an analyst, an auditor and sometimes the customer-facing team. Use per-customer reason codes, such as SHAP values (a method that attributes each prediction to its input features). Check that the codes are stable and make business sense.
- Monotonicity. A rating should not fall when a risk input rises. Most libraries let you enforce monotonic constraints per feature. Use them for factors like geography score.
- Validation burden. Model risk management expects documented development, independent validation, performance monitoring and a challenger comparison. This is more work than for a scorecard.
Unsupervised methods such as isolation forests or clustering need no labels. They flag customers who differ from their peer group, which is useful for finding gaps in the scorecard, for example a segment that is always rated Low yet looks unusual. Treat the output as a review queue for analysts. An "anomalous" customer is not necessarily a high-risk one.
A hybrid design
Most production designs keep a transparent skeleton and add a learned component where it helps.
Common ways to combine the two:
- Champion and challenger. The scorecard stays in production while the model runs in shadow. You compare the two and investigate every material disagreement.
- Model suggests, analyst decides. The model can raise a rating for review but cannot lower one without human sign-off.
- Calibration aid. Use the fitted coefficients to check or adjust the scorecard's weights, then keep the scorecard in production.
Validating a learned model
Validation extends the tests from the previous chapter.
- Out-of-time testing. Split by date, not randomly. Train on older customers and test on newer ones. Random splits leak information because customer behavior drifts.
- Leakage checks. Do not include inputs created after the rating, such as alert counts, SAR history or account closures. They predict the label because they come from it.
- Stability. Compare score distributions across periods with a measure such as the population stability index. A shift means the model sees a different customer base than it was built on.
- Segment performance. Check ranking power by product, region and customer type. A good overall AUC can hide a segment where the model performs no better than chance.
- Fairness and proxy variables. Nationality, postcode and name-derived features can encode protected characteristics. Review them with legal and compliance.
Common errors
- Treating SAR counts as ground truth and then claiming the model "found" the risky customers.
- Reporting accuracy on a 1% positive class.
- Using a random train/test split on time-dependent data.
- Letting the model's score replace PEP and sanctions overrides.
- Shipping a model nobody can explain to an examiner.
- Re-training automatically without change control, so the rating logic changes without anyone approving it.
Exercise
A bank trains a logistic regression on "SAR filed within 12 months" as the label. Its test AUC is 0.91, but the model uses "number of transaction-monitoring alerts in the last 12 months" as an input. Name two problems and one fix for each.
Show answer
Problem 1 is label leakage: alerts are a main trigger for SARs, so the input is created by the process that generates the label. The AUC is inflated and the model cannot rate a new customer who has no alert history. Fix: remove inputs generated after the rating date and use only data available at the rating time. Problem 2 is the feedback loop: the label reflects existing scrutiny, so the model learns to reproduce the current monitoring system instead of finding unseen risk. Fix: add other labels or a uniformly sampled review population, validate out of time, and treat the output as a relative ranking.
Exercise
Why should PEP and sanctions overrides stay in place when a trained model is used for rating?
Show answer
They are policy and legal requirements that do not depend on the statistical risk estimate. A model trained on few such cases may score them low, so the override must apply regardless of the model's output.