Comments (5)
I know this is an old thread, but thought I would chime in anyway. The haversine metric requires radians instead of lat/lon, and so the epsilon also have to be calculated as meters / metersperradian. If we want an eps that corresponds to 2000m, we need to input:
ms_per_radian = 6373000.0
eps = 2000 / ms_per_radian
For the lat/lon-data, the simplest is to just convert to radians by using:
X = np.radians(X)
from hdbscan.
It is quite possible you are not doing anything wrong. I've had some private reports of weirdness with Haversine. In reflection I suspect that perhaps it doesn't play well with the Boruvka algorithm given it's presumption of a compact manifold which I'm not sure Boruvka is going to handle in quite the way one would expect. To test that theory you could try:
hdb = HDBSCAN(min_cluster_size=3, metric='haversine', algorithm='prims_balltree').fit(sample_data)
hdb_labels = hdb.labels_
n_clusters_hdb_ = len(set(hdb_labels)) - (1 if -1 in hdb_labels else 0)
and see if that gives more sensible results. I suspect it may. If it does then I'll have to add some checks to ensure Haversine uses Prims. If it doesn't ... Haversine may just be broken. I'll have to look into it further.
from hdbscan.
from hdbscan.
I know this is an old thread, but thought I would chime in anyway. The haversine metric requires radians instead of lat/lon, and so the epsilon also have to be calculated as meters / metersperradian. If we want an eps that corresponds to 2000m, we need to input:
ms_per_radian = 6373000.0
eps = 2000 / ms_per_radianFor the lat/lon-data, the simplest is to just convert to radians by using:
X = np.radians(X)
Thanks, that's actually very helpful!
…
On Fri, Mar 10, 2017 at 2:52 AM, thomasht86 @.***> wrote: I know this is an old thread, but thought I would chime in anyway. The haversine metric requires radians instead of lat/lon, and so the epsilon also have to be calculated as meters / metersperradian. If we want an eps that corresponds to 2000m, we need to input: ms_per_radian = 6373000.0 eps = 2000 / ms_per_radian For the lat/lon-data, the simplest is to just convert to radians by using: X = np.radians(X) — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#29 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ALaKBfG7t4MgRNucHVSuVwRLQXS7AoJgks5rkQEtgaJpZM4H0v9V .
however, eps cannot be applied on HDBSCAN algorithm. This usage is only for DBSCAN. is it right?
from hdbscan.
Yes, eps is not relevant in this case, but the conversion to radians remains important.
from hdbscan.
Related Issues (20)
- TypeError encountered HOT 2
- Getting Error while using HDBSCAN HOT 1
- Clustering struggles with mix of noise levels HOT 1
- HDBSCAN version 0.8.33 not able to install with python version 3.10.13 HOT 2
- Tests failed with: No module named 'hdbscan._hdbscan_linkage'
- Request for Adding `__version__` Attribute HOT 1
- Request for `verbose` setting
- max_cluster_size parameter does not work
- ip
- Question regarding sparse matrices
- Crash when points are equal HOT 1
- Way to obtain the lambda value HOT 1
- requirements prevent cython>=3 HOT 1
- How to set cluster_selection_epsilon when using cosine distances?
- Outlier scores - possible bug in GLOSH computation
- Can't install HDBSCAN via pip: [WinError 5] Access is denied HOT 1
- HDBScan performance issue when choosing Best algorithm HOT 5
- How to provide pre-calculated medoids to HDBSCAN
- Archive repo? HOT 1
- Can't install hdbscan in conda environment with gcc-14 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hdbscan.