Coder Social home page Coder Social logo

solzimer / sdbscan Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 1.0 156 KB

dbscan cluster algorythm for javascript. works in node and browser

JavaScript 100.00%
dbscan spatial cluster clustering noise density groups classification unidimensional multidimensional

sdbscan's Introduction

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 = require("sdbscan");

var data = [0, 1, 100, 101, 2, 102, 3, 104, 4, 103, 105, 5];
var res = sdbscan(data,2,3);

Browser

<!doctype html>
<html>
<head>
	<script src="sdbscan.js"></script>
</head>
<body>
	<script>
		var data = [0,1,100,101,2,102,3,104,4,103,105,5];
		var res = sdbscan(data,2,3);

		console.log(data);
		console.log(res);
	</script>
</body>
</html>

Results

{
	"noise": [],
	"clusters": [
    {
      "id": 0,
      "data": [5,4,3,2,1,0]
    },
    {
      "id": 1,
      "data": [105,103,104,102,101,100]
    }
  ]
}

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.

sdbscan's People

Contributors

solzimer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

0watermelon0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.