data-clustering
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"scripts": { | ||
@@ -11,0 +11,0 @@ "webpack": "webpack" |
@@ -135,2 +135,3 @@ import {mean, std, corr, dotp, L2_norm} from './statistic'; | ||
export function correlation_similarity(a, b){ | ||
if(a.length <= 1) return 0; | ||
var ma = mean(a); | ||
@@ -153,3 +154,3 @@ var mb = mean(b); | ||
}); | ||
return dotp(ak, bk); | ||
return dotp(ak, bk) / (a.length - 1); | ||
} | ||
@@ -156,0 +157,0 @@ |
@@ -74,2 +74,3 @@ import {isArray} from './utils.js'; | ||
else{ | ||
if(v.length <= 1) return 0; | ||
m = mean(v); | ||
@@ -80,3 +81,3 @@ sum = 0; | ||
} | ||
return sum / v.length; | ||
return sum / (v.length - 1); | ||
} | ||
@@ -83,0 +84,0 @@ } |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6827811
111504