logfiles_analysis / isolation_forest.py
Jasper Siebelink
OC_SVM support
06b052d
raw
history blame contribute delete
334 Bytes
#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)