An open API service indexing awesome lists of open source software.

https://github.com/matiasinsaurralde/dbscan

DBSCAN implementation (forked from shiguodong/dbscan)
https://github.com/matiasinsaurralde/dbscan

Last synced: 7 months ago
JSON representation

DBSCAN implementation (forked from shiguodong/dbscan)

Awesome Lists containing this project

README

          

dbscan
======

DBSCAN implementation (forked from shiguodong/dbscan)

```
$ gem install dbscan
```

```
$ ruby examples/simple.rb
```

Example:

```ruby
input = [ 0, 10, 20 ],
[ 0, 11, 21 ],
[ 0, 12, 20 ],
[ 20, 33, 59 ],
[ 21, 32, 56 ],
[ 59, 77, 101 ],
[ 58, 79, 100 ],
[ 58, 76, 102 ],
[ 300, 70, 20 ],
[ 500, 300, 202],
[ 500, 302, 204 ]
```

Output:

```ruby
{-1=>[[300, 70, 20]],
0=>[[0, 10, 20], [0, 11, 21], [0, 12, 20]],
1=>[[20, 33, 59], [21, 32, 56]],
2=>[[59, 77, 101], [58, 79, 100], [58, 76, 102]],
3=>[[500, 300, 202], [500, 302, 204]]}
```