Created
August 19, 2018 14:41
-
-
Save joaofig/8ca9cf170eadee2f09b2a7643b70b6ab to your computer and use it in GitHub Desktop.
Running DBSCAN
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
# Cluster the data | |
from sklearn.cluster import DBSCAN | |
earth_perimeter = 40070000.0 # In meters | |
eps_in_radians = eps_in_meters / earth_perimeter * (2 * math.pi) | |
uk_acc['cluster'] = DBSCAN(eps=eps_in_radians, min_samples=num_samples, metric='haversine').fit_predict(uk_acc[['rad_lat', 'rad_lng']]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment