## Wilson Score Confidence interval

Not sure where I got this snipplet - most likely from reddit code or discussion.

from math import sqrt def confidence_fixed(ups, downs): if ups == 0: return -downs n = ups + downs z = 1.64485 #1.0 = 85%, 1.6 = 95% phat = float(ups) / n return (phat+z*z/(2*n)-z ...more ...