report negative score chance on janitor trial report

This commit is contained in:
r888888888
2015-08-20 14:23:45 -07:00
parent d44dd09a88
commit e06d8a3cc7
2 changed files with 11 additions and 3 deletions

View File

@@ -27,11 +27,17 @@ module Reports
ActiveRecord::Base.select_value_sql("select percentile_cont(0.50) within group (order by score) from posts where created_at >= ? and approver_id = ?", since, user.id).to_i
end
def deletion_confidence
def deletion_chance
hits = Post.where("approver_id = ? and created_at >= ? and is_deleted = true", user.id, since).count
total = Post.where("approver_id = ? and created_at >= ?", user.id, since).count
Reports::UserPromotions.ci_lower_bound(hits, total, 0.95).to_i
end
def neg_score_chance
hits = Post.where("approver_id = ? and created_at >= ? and score < 0", user.id, since).count
total = Post.where("approver_id = ? and created_at >= ?", user.id, since).count
Reports::UserPromotions.ci_lower_bound(hits, total, 0.95).to_i
end
end
def janitors