Sub topic 7
Thresholds and tuning: false positives versus missed matches
This chapter assumes you know how names are normalized and scored (see the previous chapters) and can read short Python. A threshold is the score at or above which the system raises an alert. It looks like a single number, but it decides how much work your analysts get and how many sanctioned parties you might miss.
The two errors
Every threshold produces two kinds of mistakes:
- A false positive is an alert on a customer who is not the listed party. It costs review time.
- A missed match (false negative) is no alert on a customer who is the listed party. It can mean a sanctions breach.
Lowering the threshold catches more true matches and raises more false positives. Raising it does the reverse. You cannot remove both errors by moving one number, because real true matches and look-alikes often have overlapping scores.
The costs are not symmetric. A missed true match is a compliance failure, while a false positive is an operating cost. Regulators generally expect firms to accept a high false-positive rate before accepting a material risk of missing matches. Even so, an alert queue so large that analysts clear it carelessly is also a control failure.
Measuring a threshold
Do not pick a threshold by instinct. Build a labeled test set of name pairs, each marked as a true match or not, and measure each candidate threshold against it. Include the cases you worry about most: reordered names, transliteration variants, and similar but different names.
import re
import unicodedata
from difflib import SequenceMatcher
def normalize(name: str) -> str:
decomposed = unicodedata.normalize("NFKD", name)
no_accents = "".join(c for c in decomposed if not unicodedata.combining(c))
no_punct = re.sub(r"[^\w\s]", " ", no_accents.casefold())
return " ".join(no_punct.split())
def token_sort_score(a: str, b: str) -> float:
ta = " ".join(sorted(normalize(a).split()))
tb = " ".join(sorted(normalize(b).split()))
return SequenceMatcher(None, ta, tb).ratio()
listed = ["Mohammed Al-Sayed", "Ivan Petrov"]
# (customer name, is this really a listed party?)
cases = [
("Al Sayed, Mohamed", True),
("Mohamed Alsayed", True),
("Ivan Petrow", True),
("Ivana Petrova", False),
("Jane Doe", False),
("John Smith", False),
]
scored = [
(max(token_sort_score(name, entry) for entry in listed), is_match)
for name, is_match in cases
]
for threshold in (0.70, 0.80, 0.90, 0.95):
alerts = [(s, m) for s, m in scored if s >= threshold]
false_pos = sum(1 for _, m in alerts if not m)
missed = sum(1 for s, m in scored if m and s < threshold)
print(f"threshold={threshold:.2f} alerts={len(alerts)} "
f"false_positives={false_pos} missed={missed}")Run it and compare the rows. At a low threshold, the near-identical "Ivana Petrova" alerts alongside the true matches. At a high threshold, some true variants stop alerting. No setting on this tiny set separates every case, which is the point: the choice is a trade-off you must justify.
What to tune
The threshold is only one lever. Tuning often works better with several:
- Per-field thresholds. Individuals, entities, and vessels behave differently. Short names score unreliably, so they may need a different setting from long ones.
- Algorithm choice. Combine a token-based score with a phonetic check, and alert if either is high, so that you do not rely on one method's blind spots.
- Good-guy lists. Record parties that you have already cleared, tied to the identifiers that cleared them, so the same false positive does not return. Re-open the entry when the identifiers change.
- Secondary identifiers. Use date of birth or country to lower the priority of an alert, not to suppress it silently.
Change one lever at a time and re-run the same test set. Otherwise you cannot tell which change caused the result.
Governing the change
Treat a threshold as a controlled setting. Record who changed it, the old and new values, the test results that supported the change, and who approved it. Retest after list changes, after new data sources, and on a regular schedule, because customer and list populations drift. Some firms also run a "below the line" sample, reviewing a random set of scores just under the threshold to see whether true matches are hiding there.
Common errors
- Choosing a threshold that was tuned on clean test names but used on messy real data.
- Using one global threshold for all name types and lengths.
- Tuning only to reduce false positives, with no measurement of missed matches.
- Changing settings without a record of the reason and approval.
Exercise
Your team raises the threshold from 0.85 to 0.92 and alert volume drops by 40%. What must you check before accepting the change, and why?
Show answer
Re-run the labeled test set, especially transliteration variants, reordered names, and known true matches, to see whether any true matches now fall below 0.92. A drop in alerts could come from removed false positives or from missed matches, and alert volume alone cannot tell you which. Also sample scores just below the new threshold and record the test results, the approver, and the reason for the change.