Gathering detailed insights and metrics for density-clustering
Gathering detailed insights and metrics for density-clustering
Gathering detailed insights and metrics for density-clustering
Gathering detailed insights and metrics for density-clustering
npm install density-clustering
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
217 Stars
27 Commits
33 Forks
12 Watching
1 Branches
2 Contributors
Updated on 09 Nov 2024
JavaScript (99.22%)
HTML (0.78%)
Cumulative downloads
Total Downloads
Last day
-40.7%
88,559
Compared to previous day
Last week
0.5%
690,442
Compared to previous week
Last month
0.7%
2,827,363
Compared to previous month
Last year
25.8%
22,685,651
Compared to previous year
6
Package contains popular methods for cluster analysis in data mining:
Density-based spatial clustering of applications with noise (DBSCAN) is one of the most popular algorithm for clustering data.
http://en.wikipedia.org/wiki/DBSCAN
Ordering points to identify the clustering structure (OPTICS) is an algorithm for clustering data similar to DBSCAN. The main difference between OPTICS and DBSCAN is that it can handle data of varying densities.
http://en.wikipedia.org/wiki/OPTICS_algorithm
Important
Clustering returned by OPTICS is nearly indistinguishable from a clustering created by DBSCAN. To extract different density-based clustering as well as hierarchical structure you need to analyse reachability plot generated by OPTICS.
For more information visit http://en.wikipedia.org/wiki/OPTICS_algorithm#Extracting_the_clusters
K-means clustering is one of the most popular method of vector quantization, originally from signal processing. Although this method is not density-based, it's included in the library for completeness.
http://en.wikipedia.org/wiki/K-means_clustering
Node:
1npm install density-clustering
Browser:
1bower install density-clustering 2# build 3npm install 4gulp
1var dataset = [ 2 [1,1],[0,1],[1,0], 3 [10,10],[10,13],[13,13], 4 [54,54],[55,55],[89,89],[57,55] 5]; 6 7var clustering = require('density-clustering'); 8var dbscan = new clustering.DBSCAN(); 9// parameters: 5 - neighborhood radius, 2 - number of points in neighborhood to form a cluster 10var clusters = dbscan.run(dataset, 5, 2); 11console.log(clusters, dbscan.noise); 12 13/* 14RESULT: 15[ 16 [0,1,2], 17 [3,4,5], 18 [6,7,9], 19 [8] 20] 21 22NOISE: [ 8 ] 23*/
1// REGULAR DENSITY 2var dataset = [ 3 [1,1],[0,1],[1,0], 4 [10,10],[10,11],[11,10], 5 [50,50],[51,50],[50,51], 6 [100,100] 7]; 8 9var clustering = require('density-clustering'); 10var optics = new clustering.OPTICS(); 11// parameters: 2 - neighborhood radius, 2 - number of points in neighborhood to form a cluster 12var clusters = optics.run(dataset, 2, 2); 13var plot = optics.getReachabilityPlot(); 14console.log(clusters, plot); 15 16/* 17RESULT: 18[ 19 [0,1,2], 20 [3,4,5], 21 [6,7,8], 22 [9] 23] 24*/
1// VARYING DENSITY 2var dataset = [ 3 [0,0],[6,0],[-1,0],[0,1],[0,-1], 4 [45,45],[45.1,45.2],[45.1,45.3],[45.8,45.5],[45.2,45.3], 5 [50,50],[56,50],[50,52],[50,55],[50,51] 6]; 7 8var clustering = require('density-clustering'); 9var optics = new clustering.OPTICS(); 10// parameters: 6 - neighborhood radius, 2 - number of points in neighborhood to form a cluster 11var clusters = optics.run(dataset, 6, 2); 12var plot = optics.getReachabilityPlot(); 13console.log(clusters, plot); 14 15/* 16RESULT: 17[ 18 [0, 2, 3, 4], 19 [1], 20 [5, 6, 7, 9, 8], 21 [10, 14, 12, 13], 22 [11] 23] 24*/
1var dataset = [ 2 [1,1],[0,1],[1,0], 3 [10,10],[10,13],[13,13], 4 [54,54],[55,55],[89,89],[57,55] 5]; 6 7var clustering = require('density-clustering'); 8var kmeans = new clustering.KMEANS(); 9// parameters: 3 - number of clusters 10var clusters = kmeans.run(dataset, 3); 11console.log(clusters); 12 13/* 14RESULT: 15[ 16 [0,1,2,3,4,5], 17 [6,7,9], 18 [8] 19] 20*/
Open folder and run:
1mocha -R spec
Software is licensed under MIT license. For more information check LICENSE file.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 2/24 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More