What makes anomalies hard
What it is
An anomaly is rare and unlike the rest. Both halves cause trouble: rare means there are too few examples to learn a positive class from, and unlike-the-rest means new anomalies need not resemble the old ones, so a classifier trained on last year's frauds can miss this year's entirely.
Why it matters
It decides the shape of the whole problem. Because you cannot reliably learn 'what an anomaly looks like', almost every method here instead learns 'what normal looks like' and scores distance from it — which is why they are unsupervised even when a few labels exist.
In the real world: Fraud is rare, varied and constantly changing, so there are few labelled examples to learn from.
import numpy as np
# 100,000 transactions, 100 of them fraudulent.
n, n_bad = 100_000, 100
prevalence = n_bad / n # 0.001
# A model that predicts 'normal' every single time:
accuracy = (n - n_bad) / n # 0.999
recall = 0.0 # it catches nothing
print(f"prevalence {prevalence:.3%} accuracy {accuracy:.3%} recall {recall:.1%}")
# And a five-fold split leaves only about 20 positives per fold to evaluate on.
n_bad / 5Framing it as supervised classification when there are 40 positive examples. A classifier will memorise those 40 and generalise to nothing; the useful information in them is as a *validation* set for an unsupervised detector, not as a training set for a discriminator.