【发布时间】:2014-02-16 14:11:25
【问题描述】:
var minCount = 10; // Used as 0, anything below 10 uses will be ignored
User hasMany Attributes
Attribute (id, value, count, worth)
// Count - number of users who associate with this attribute
// Worth - float 0.1 (or a better non-zero number?) to 1
计数为 minCount 的属性值为 1。 具有最高计数的属性具有最低可能的价值。 较少使用的属性价值更高 - 数量更少 -> 价值更高。
价值的差异应该是指数级的:
- 常用属性(高计数)- 价值差距较小
- 不常见的属性(数量少) - 价值差距较大
我现在将使用 php,但伪代码同样可以接受 - 我宁愿只是了解如何去做。
【问题讨论】:
-
你可能想使用某种对数函数。
标签: php math exponential inverse