Created
July 1, 2020 19:58
-
-
Save Younes-Charfaoui/8f1391c412f92a1f38f1549170b521fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # import the libraries | |
| from sklearn.cluster import DBSCAN | |
| import pandas as pd | |
| # read your data | |
| data = pd.read_csv("yourData.csv") | |
| # create the isolation forest | |
| outlier_detection = DBSCAN(eps = 0.2, metric=”euclidean”, min_samples = 5, n_jobs = -1) | |
| # fit and predict the outliers | |
| outliers_cluster = outlier_detection.fit_predict(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment