【发布时间】:2013-07-29 12:00:33
【问题描述】:
如果有这样的数列:11.5、6.7、3.2 和 5.11
如何将这些数字转换为概率,使结果概率之和为 1?
谢谢。
如果数列还包含负数:-1.2、-100.34、3.67 和 2.1 怎么办?
是的,它们是与实例的 4 个可能类相关联的权重。
好的。这是我的解决方案。如果有任何改进,请随时提出改进建议。
1) 通过method 将数字范围移动到 1 到任意 n(我选择 100)之间。
2) 使用答案中列出的解决方案。
在步骤1)中选择下限为1的原因是为了在应用范围转换公式后不丢失最小值。
解决的例子:
Say there 2 instances that can take on 2 possible class values with weights as shown below.
Instance1: -11.0 -2.0
Instance2: 4.0 52.0
old_max = 52.0, old_min = -11.0, new_max = 100, and new_min = 1
After applying step1), the weights are now in range 1 to 100.
Instance1: 1 15.1
Instance2: 24.5 100
On applying step2), the following probabilities are obtained.
Instance1: 0.0708 0.937
Instance2: 0.19 0.803
【问题讨论】:
-
将它们全部相加,然后将它们除以总和!
-
输入的数字代表什么?您可能只需要对它们进行规范化(正如大多数答案所暗示的那样),也可能不需要。
-
输入数字表示实例属于特定类的权重。仅供参考:它是 svm_multiclass 程序的分类输出。
标签: java numbers probability series