Add additional post flag validation preventing targeting

This commit is contained in:
Albert Yi
2018-06-15 17:11:06 -07:00
parent f4d5932a66
commit cdcd4d4014
5 changed files with 191 additions and 56 deletions

View File

@@ -0,0 +1,11 @@
class DanbooruMath
def self.ci_lower_bound(pos, n, confidence = 0.95)
if n == 0
return 0
end
z = Statistics2.pnormaldist(1-(1-confidence)/2)
phat = 1.0*pos/n
100 * (phat + z*z/(2*n) - z * Math.sqrt((phat*(1-phat)+z*z/(4*n))/n))/(1+z*z/n)
end
end