Skip to content

Instantly share code, notes, and snippets.

@wmlba
Created March 5, 2019 13:41
Show Gist options
  • Save wmlba/767efb617ebd3dd50555bfe60c384a21 to your computer and use it in GitHub Desktop.
Save wmlba/767efb617ebd3dd50555bfe60c384a21 to your computer and use it in GitHub Desktop.
from sklearn.ensemble import IsolationForest
import numpy as np
np.random.seed(1)
random_data = np.random.randn(50000,2) * 20 + 20
clf = IsolationForest( behaviour = 'new', max_samples=100, random_state = 1, contamination= 'auto')
preds = clf.fit_predict(random_data)
preds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment