Spaces:
Running
Running
| #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) | |