sdbscan
Super fast density based spatial clustering DBSCAN implementation for unidimiensional and multidimensional data. Works on nodejs and browser.
Installation
npm install sdbscan
Usage
NodeJS
const sdbscan = ; var data = 0 1 100 101 2 102 3 104 4 103 105 5;var res = ;
Browser
Results
"noise": "clusters": "id": 0 "data": 543210 "id": 1 "data": 105103104102101100
API
sdbscan(data,epsilon,min)
Calculates unidimiensional and multidimensional dbscan clustering on data. Parameters are:
- data Unidimiensional or multidimensional array of values to be clustered. for unidimiensional data, takes the form of a simple array [1,2,3.....,n]. For multidimensional data, takes a NxM array [[1,2],[2,3]....[n,m]]
- epsilon Maximum distance for two points to be considered in the same region.
- min Minimal region size. If a region for a point is lesser than min, this point will be considered as noise (cannot be included in any group).
The function will return an object with the following data:
- noise Points that cannot be added to any cluster.
- clusters An array of clusters, with an ID and the data points belonging to it.