Share Pastebin
Guest
Public paste!

macey

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