Check your understanding

Quiz

You have built seven detectors, each seeing a different shape of "does not belong": isolation forests that fence off outliers in a few cuts, the local outlier factor and one-class SVM for density and boundaries, autoencoders that score by how badly a point rebuilds, the decomposition that exposes a time-series anomaly, the factorizations beyond plain PCA, and a contrastive representation learned with no labels. Running through all of them is one honest rule: anomalies are rare, so judge a detector by precision and recall, never accuracy. This quiz checks what stuck. The last two steps are live R you can run.

Question 1 of 10

The 99%-accurate detector

A fraud detector is 99% accurate on transactions where 0.5% are truly fraud. Why can that number be almost meaningless?

Exactly. Accuracy is swamped by the huge normal class. You must see precision (are the alerts real?) and recall (is fraud caught?) before trusting a rare-event detector.
They measure different things: precision is the share of alerts that are real, recall the share of true anomalies caught. Neither is captured by accuracy on imbalanced data.