mathhelp
v1.0.2
Published
math,cossim,余弦相似度,方差,标准差,协方差,协相关,点积
Downloads
1
Readme
#方法说明
const { similarity, dot, similarityByLen, arrSum, covariance, standardDeviation, correlationCoefficient } = require("mathhelp");
// 相似度
console.log(similarity([1, 2], [1, 2]))
// 点乘
console.log(dot([3, 4], [3, 4]))
console.log(similarityByLen([3, 4], [4, 3], 5, 5))
// 求和
console.log(arrSum([1, 2, 3]))
// 计算协方差
console.log(covariance([1, 2], [1, 2]))
// 计算标准差差
console.log(standardDeviation([1, 2, 3]))
// 计算协相关系数
console.log(correlationCoefficient([2, 3, 4, 1], [4, 3, 2, 1]))