Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

density-clustering

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

density-clustering

Density Based Clustering in JavaScript

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is density-clustering?

The density-clustering npm package provides algorithms for clustering data points based on their density. It includes popular clustering algorithms such as DBSCAN, OPTICS, and KMEANS, which are useful for identifying clusters in data sets where the clusters may have irregular shapes or varying densities.

What are density-clustering's main functionalities?

DBSCAN

DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a popular clustering algorithm that groups together points that are closely packed together, marking as outliers points that lie alone in low-density regions. The code sample demonstrates how to use the DBSCAN algorithm to cluster a simple dataset.

const clustering = require('density-clustering');
const dbscan = new clustering.DBSCAN();
const dataset = [[1,2], [2,3], [2,2], [8,7], [8,8], [25,80]];
const clusters = dbscan.run(dataset, 2, 2);
console.log(clusters);

OPTICS

OPTICS (Ordering Points To Identify the Clustering Structure) is an algorithm that creates an ordering of the database that represents its density-based clustering structure. The code sample shows how to use the OPTICS algorithm to cluster a dataset.

const clustering = require('density-clustering');
const optics = new clustering.OPTICS();
const dataset = [[1,2], [2,3], [2,2], [8,7], [8,8], [25,80]];
const clusters = optics.run(dataset, 2, 2);
console.log(clusters);

KMEANS

KMEANS is a well-known clustering algorithm that partitions the dataset into K clusters, where each data point belongs to the cluster with the nearest mean. The code sample demonstrates how to use the KMEANS algorithm to cluster a dataset into 3 clusters.

const clustering = require('density-clustering');
const kmeans = new clustering.KMEANS();
const dataset = [[1,2], [2,3], [2,2], [8,7], [8,8], [25,80]];
const clusters = kmeans.run(dataset, 3);
console.log(clusters);

Other packages similar to density-clustering

Keywords

FAQs

Package last updated on 23 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc