# The affect of bootstrap on Isolation Forest

I've been using isolation forest for anomaly detection, and reviewing its parameters at scikit-learn (link). Looking at "bootstrap", I'm not quite clear what using bootstrap would cause. For supervised learning, this should reduce overfitting, but I'm not clear what the effect on anomaly detection should be.

I think it would require the trees to achieve more "consensus" about what the anomaly is, therefore, reducing the effect of any single feature. I.e, an anomalous observation would probably need to be anomalous consistently and over a number of features (?).

Is this a correct interpretation of this parameter?

• Your argument seems correct for the effect of a smaller max_features, but not really for bootstrap. (I can't think of a particularly clear effect for bootstrap, except that it effectively decreases the sample size for a given max_samples.) May 13 '21 at 14:18
• I was mistaken in how bootstrap is used. @Julio's answer cleared that up for me. May 13 '21 at 17:53

This is well explained on the original paper Section 3.

As well as in the Supervised Random Forest, Isolation Forest makes use of sampling on both, features and instances, so the latter in this case helps alleviate 2 main problems:

1. Swamping

Swamping refers to wrongly identifying normal instances as anomalies. When normal instances are too close to anomalies, the number of partitions required to separate anomalies increases – which makes it harder to distinguish anomalies from normal in- stances.