Loading…
Glossary term
Identifying data points that differ markedly from the norm, such as fraud.
Anomaly detection finds items that differ markedly from the rest: a suspicious transaction, a failing machine, a network intrusion. Methods learn what 'normal' looks like and flag what does not fit.
Because anomalies are rare and varied, labelled examples are scarce.
Flag outliers with Isolation Forest
from sklearn.ensemble import IsolationForest
labels = IsolationForest(random_state=0).fit_predict(X) # -1 = anomalyIt catches fraud, faults and attacks that rules written in advance would miss.