File size: 334 Bytes
06b052d
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12

#Isolation Forest

from matplotlib.pylab import RandomState
from sklearn.ensemble import IsolationForest
import numpy as np

def apply_isolation_forest( rng: RandomState,
                            all_data: np.ndarray) -> np.ndarray:
    clf = IsolationForest(max_samples=40, random_state=rng)
    return clf.fit_predict(all_data)