macey
By: a guest | Feb 9th, 2010 | Syntax:
Python | Size: 0.25 KB | Hits: 11 | Expires: Never
def probVector(sortedData):
a = [float(0)]*20
b = toBernoulli(sortedData) # toBernoulli converts a sorted vector to binary Bernoulli form
l = len(sortedData)
for j in range(20):
for x in b:
a[i] = a[i] + (float(b[i])/float(l)
return a