entropy-ts
信息熵,使用 TypeScript 实现。
信息熵
在机器学习中,熵刻画了任意样例集的纯度。给定包含关于某个目标概念的正反样例的样例集 S,那么 S 相对这个布尔型分类的熵为:
Entropy(S) = -p+log2(p+) - p-log2(p-)
其中,p+是在 S 中正例的比例,p-是在 S 中反例的比例。在有关熵的所有计算中我们定义 0log0 为 0。
安装
npm install entropy-ts
使用
assert.deepStrictEqualres, 1
开发
-
修改代码后跑
npm test确保测试通过。
-
git commit
-
npm version patch/minor/major
-
npm publish