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

skmeans

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skmeans - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

10

main.js
/*jshint esversion: 6 */
const MAX = 10000;
const abs = Math.abs;
const sqrt = Math.sqrt;

@@ -18,3 +16,3 @@ /**

}
return sqrt(sum);
return Math.sqrt(sum);
}

@@ -30,3 +28,3 @@

for(let i=0;i<len;i++) {
sum += abs((v1[i]||0) - (v2[i]||0));
sum += Math.abs((v1[i]||0) - (v2[i]||0));
}

@@ -46,4 +44,2 @@ return sum;

function skmeans(data,k,initial,maxit) {
"use strict";
var ks = [], idxs = [], len = data.length;

@@ -68,3 +64,3 @@ var conv = false, it = maxit || MAX;

// Multidimensional or unidimensional
var dist = multi? eudist(data[i],ks[j]) : abs(data[i]-ks[j]);
var dist = multi? eudist(data[i],ks[j]) : Math.abs(data[i]-ks[j]);
if(dist<min) {

@@ -71,0 +67,0 @@ min = dist;

{
"name": "skmeans",
"version": "0.5.1",
"version": "0.5.2",
"description": "Super fast simple kmeans clustering for unidimiensional data",

@@ -5,0 +5,0 @@ "author": "David Gómez Matarrodona <solzimer@gmail.com>",

Sorry, the diff of this file is not supported yet

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