Skip to content

Instantly share code, notes, and snippets.

@wmlba
Created March 5, 2019 11:30
Show Gist options
  • Save wmlba/2598046986d69a4be908e8d5330395e8 to your computer and use it in GitHub Desktop.
Save wmlba/2598046986d69a4be908e8d5330395e8 to your computer and use it in GitHub Desktop.
from sklearn.cluster import DBSCAN
seed(1)
random_data = np.random.randn(50000,2) * 20 + 20
outlier_detection = DBSCAN(min_samples = 2, eps = 3)
clusters = outlier_detection.fit_predict(random_data)
list(clusters).count(-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment