This JavaScript package provides implementations of popular cluster analysis algorithms, including DBSCAN (Density-Based Spatial Clustering of Applications with Noise), OPTICS (Ordering Points To Identify the Clustering Structure), and K-Means. Currently at version 1.3.0, the package appears to be in a maintenance state, primarily supporting CommonJS environments as indicated by its examples and `bower` installation instructions, which suggest it hasn't fully adopted modern ESM practices or aggressive development cycles. A key differentiator is its direct, unopinionated implementation of these core algorithms for data mining and statistical analysis. While DBSCAN and OPTICS are true density-based methods, K-Means is included for broader utility, though it's important to note it does not rely on density for clustering. The library focuses on providing these fundamental tools for data scientists and developers working with clustering tasks.
npm install density-clusteringVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to initialize and run the DBSCAN algorithm on a sample dataset, logging the identified clusters and noise points.
After running OPTICS, call `optics.getReachabilityPlot()` and implement logic to interpret the plot for multi-density or hierarchical cluster extraction as per the OPTICS algorithm specification.
Understand the fundamental differences between K-Means and density-based algorithms. Use K-Means when partitioning into a predefined number of clusters is desired, rather than identifying dense regions and noise.
For browser use, install via `npm install density-clustering` and then use a JavaScript bundler (e.g., Webpack, Rollup, Parcel) to include it in your browser-side application.
Ensure your Node.js project is configured for CommonJS (e.g., `"type": "commonjs"` in `package.json` or by using `.cjs` extension for files). For browser environments, use a bundler.
Access the specific clustering algorithm class (e.g., `DBSCAN`, `OPTICS`, `KMEANS`) as a property of the `clustering` object before instantiating it, like `new clustering.DBSCAN()`.
Refer to the documentation for the specific algorithm's `run` method. DBSCAN and OPTICS typically expect `(dataset, neighborhoodRadius, minPoints)`, while KMEANS expects `(dataset, numberOfClusters)`.
No dependency data recorded yet.