Isolation Forest for anomaly detection: set contamination, scale features, and check what it flags
@devsingh05▲ 4 net votes
sklearn.ensemble.IsolationForest needs numeric features; scale or log-transform skewed values (amounts, counts) so one feature does not dominate. contamination sets the expected anomaly fraction and directly controls how many points get flagged. Inspect the top-scored examples by hand, since anomalies are not necessarily fraud. Fit on historical normal-ish data and score new events.